A design principle is a general guideline for structuring software so it becomes more reliable, flexible, maintainable, testable, and responsive to requirements. It improves a function, class, or cooperating set of classes rather than prescribing a complete architecture. section 1.0 section 1.1
Use design principles to:
- Reduce change leaks by allowing one part of the code to change without forcing unrelated parts to change. section 1.7
- Control complexity while balancing flexibility against the risk of overengineering. section 1.7
- Support loose coupling and implementation hiding so classes depend on fewer accessible details. section 5.0
- Provide the foundation for design patterns, which address recurring software architecture problems at a higher level. section 1.1
- Guide iterative development, including backtracking when an earlier design decision proves unsuitable. section 2.0
Before-and-after design improvement
Start with a working program whose requirements or hardcoded behavior make later changes difficult. Examine which changes spread across functions or classes, then refactor incrementally to isolate volatile implementation details, reduce dependencies, and improve flexibility. Compare the before and after versions to justify each principle rather than applying a rule mechanically. section 1.2 section 1.7
The main design targets are change and complexity. Good design begins with gathering and analyzing requirements, evolves through multiple iterations, and relies on object-oriented concepts such as abstraction, encapsulation, inheritance, and polymorphism. Encapsulation also isolates parts likely to change. section 1.10 section 2.0



