liveBook · Manning

Design pattern

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

A design pattern is an industry-proven reusable model for solving a recurring software design or architecture problem.

A design pattern is an industry-proven model for creating a custom solution to a recurring software architecture problem. It operates above individual design principles: principles improve code and patterns organize those improvements into reusable architectural approaches. section 1.1 section 1.0

Patterns address change and complexity rather than prescribing rigid rules. Good design keeps changes localized, but flexibility can also increase complexity, so selecting a pattern requires trade-offs and iterative refinement. section 1.7 section 1.9

Common architecture situations illustrate what a pattern contributes:

  • Publisher–subscriber separates a component that produces data from components that consume it; the Observer Design Pattern provides a solution model. section 1.4.5
  • Singleton models a collection containing one object, Composite models a hierarchy treated uniformly, and Decorator adds responsibilities at run time without changing the decorated class. section 14.0
Figure 1.2 Publisher–subscriber is a common software architecture problem. One application component produces data that other application components consume. The Observer Design Pattern provides a model to solve this problem.

Use the publisher–subscriber diagram to see how one producing component connects with multiple consuming components before applying the Observer model. section 1.4.5

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

How deep it goes
Defines patterns and illustrates their architectural roles, but defers detailed implementation to individual pattern treatments.
Examples
Uses publisher–subscriber, Singleton, Composite, and Decorator as concrete architecture problems and solution models.
What it assumes
Assumes object-oriented programming, basic data structures, and multi-file programming while building design skills from foundational principles.
What you can do after
Apply industry-proven patterns to develop custom solutions for common architecture problems and manage change.
How it connects
Connects design principles, object-oriented programming, encapsulation, software architecture, and the Observer Design Pattern.

Also explained in

Compare how 7 books explain design pattern →

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.