November 2025
Intermediate to advanced
542 pages
13h 43m
English
In this chapter, we will introduce several more design patterns. Once again, we’ll cover the canonical examples as well as any common alternative implementations in Python. We’ll be discussing the following:
The Adapter pattern
The Façade pattern
Lazy initialization and the Flyweight pattern
The Abstract Factory pattern
The Composite pattern
The Template pattern
Consistent with the practice in Design Patterns: Elements of Reusable Object-Oriented Software, we’ll capitalize the pattern names.
We’ll begin with the Adapter pattern. This is often used to provide a needed interface around an object with a design that doesn’t — quite — fit our needs.
Unlike most of the patterns ...
Read now
Unlock full access