๐Ÿงฉ Design Patterns with C++
Home Chapters Examples Diagrams Bibliography GitHub โ†—
  1. Home
  2. Composing and Adapting Structure
Part 6 3 chapters

Composing and Adapting Structure

Adapter, Facade, and Bridge (with PImpl), Decorator and Proxy, and Composite and Flyweight alongside the Null Object idiom.

Chapter 15

Adapter, Facade, Bridge, and PImpl

Four structural techniques taught in one cohesive shipping subsystem: an Adapter that wraps a legacy carrier rate API behind a domain interface, a Facade that fronts rating, labeling, and tracking with one call, a Bridge that lets a notification's kind and its delivery transport vary independently, and the PImpl idiom hiding a label renderer's formatting behind a compilation firewall.

35 minRead โ†’
Chapter 16

Decorator and Proxy

Two structural patterns that wrap an object behind its own interface, taught against a carrier rate pipeline and a manifest archive: Decorator stacks layers that each add one responsibility in an order that changes the result, and Proxy stands a single surrogate in front of an expensive or access-controlled subject without adding any new capability.

30 minRead โ†’
Chapter 17

Composite, Flyweight, and Null Object

Composite treats one item and a whole pallet the same, Flyweight shares a few SKU descriptors across many line items, and Null Object removes the null checks from a weight-limit walk.

30 minRead โ†’
โ† Previous part Creating Objects Under Control Next part โ†’ Coordinating and Traversing
Design Patterns with C++
Tutorial content: CC BY 4.0. Sample code: Apache 2.0.
Source on GitHub โ†—  ยท  File an issue โ†—