liveBook · Manning

Principle

As explained in Object-Oriented Software Design in C++

A design principle is a general guideline for structuring software to improve qualities such as flexibility and maintainability.

A design principle is a general guideline for structuring software so it becomes more flexible, reliable, maintainable, and easier to test. It improves a few lines of code, a function, a class, or cooperating classes. section 1.0 section 1.9

Use design principles to address the central problems of software design:

  • Handle changing requirements by isolating changes so one modification does not force unrelated code changes. section 1.1 section 1.7
  • Control complexity by making tradeoffs between flexibility and the manageability of the design. section 1.7
  • Support encapsulation and implementation hiding, limiting public access and reducing dependencies between classes. section 5.0 section 1.9
  • Provide the foundation for design patterns, which address common software architecture problems at a higher level. section 1.0 section 5.0

Refactoring toward a principle

Start with a before-design program, identify how a requirement change or class dependency could spread through the code, and then refactor incrementally. Compare the after-design version to see how implementation hiding, loose coupling, or another named principle limits the change. If a design decision proves poor, backtrack and continue iterating rather than expecting a single final coding pass. section 1.2 section 2.0 section 5.0

Good design principles are applied during requirements analysis and repeated development iterations; they are practical tools rather than rigid rules. Their value lies in balancing flexibility, complexity, and the need to recover from bad decisions. section 1.7 section 1.9 section 2.0

How Object-Oriented Software Design in C++ covers it

How deep it goes
Explains application across lines, functions, classes, and class groups, then connects principles to encapsulation, coupling, and patterns.
Examples
Uses before-and-after C++ programs, iterative application development, requirements analysis, implementation hiding, and backtracking over poor decisions.
What it assumes
Assumes beginner-to-intermediate C++, basic data structures and algorithms, object-oriented programming, and multi-file programming workflows.
What you can do after
Apply design principles to improve code, manage change and complexity, and refine applications through iteration and backtracking.
How it connects
Connects design patterns, object-oriented programming, encapsulation, abstraction, inheritance, polymorphism, loose coupling, and requirements analysis.

Also explained in

Compare how 4 books explain principle →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Object-Oriented Software Design in C++. The section links point to the parts of the book it draws on.