14 The Singleton, Composite, and Decorator Design Patterns

This chapter covers

  • The Singleton Design Pattern
  • The Composite Design Pattern
  • The Decorator Design Pattern

This chapter’s design patterns provide models for solving architecture problems where we must manage a collection of one or more objects so that the it behaves in a unified way. Applying the right design pattern can simplify the application’s code that works with the objects, and it can also make the code more flexible.

The Singleton Design Pattern models the simplest case of a collection with only one object. Only one instance of its class, the singleton object, can exist during ...

Get Object-Oriented Software Design in C++ now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.