12

Advanced Design Patterns

In this chapter, we will be introduced to 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

The case study for this chapter will demonstrate how to apply a few of these patterns to the iris sample problem. In particular, we'll show how much of the design has been based – implicitly – on a number of these patterns.

Consistent with the practice in Design Patterns: Elements of Reusable Object-Oriented Software, we'll capitalize the pattern ...

Get Python Object-Oriented Programming - Fourth Edition 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.