๐Ÿ Design Patterns with Python
Home Chapters Examples Diagrams Bibliography GitHub โ†—
  1. Home
  2. Composing and Adapting Structure
Part 7 3 chapters

Composing and Adapting Structure

Adapter, Facade, and Bridge; the Decorator pattern told apart from the @decorator syntax, with Proxy; and Composite with Flyweight.

Chapter 19

Adapter, Facade, and Bridge

Duck typing removes an adapter only where shapes and units already agree; a facade is often a module function, and a bridge separates two axes of variation behind a narrow Protocol.

Read โ†’
Chapter 20

Decorator the pattern vs @decorator the syntax, and Proxy

The Decorator pattern composes wrapper objects while the program runs, the @decorator syntax rebinds a name once at definition time, and a proxy keeps the interface to control access.

Read โ†’
Chapter 21

Composite and Flyweight

A consignment and a consolidation of consignments answer the same question through a closed union, and a flyweight pool shares one frozen commodity among them while deciding who builds it and how long it lives.

Read โ†’
โ† Previous part Creating Objects Under Control Next part โ†’ Coordinating and Traversing
Design Patterns with Python
Prose, diagrams and decks: CC BY 4.0. Sample code: Apache 2.0.
Source on GitHub โ†—  ยท  File an issue โ†—