How does ISP improve code flexibility?
ISP improves code flexibility by:
- Allowing classes to only depend on what they actually use
- Making it easier to extend or replace functionality without affecting unrelated parts
- Enabling composition over inheritance
- Making interfaces easier to mock or stub in unit tests
- Encouraging clean, modular design
Smaller interfaces result in lower coupling and better maintainability.