Skip to main content
Loading page…
Python Mastery
Chapter 20
Lesson 2 of 4
Structural Patterns
Contents
Notes
Tutor
Concept
Structural Patterns: Composing Objects and Interfaces
Loading activity…
Previous
1 / 10
Continue
Contents
Notes
Discussion
Tutor
26 min
10 activities
0 of 10 done
In this lesson
1
Structural Patterns: Composing Objects and Interfaces
2
Adapter: Reconciling Incompatible Interfaces
3
Facade: Simplifying a Subsystem
4
Worked Example: Composite for a File System Tree
5
Proxy: Controlling Access
6
The Decorator Pattern vs. @decorator Syntax
7
Practice: Implement a Logging Proxy
8
Facade vs. Adapter: What Is the Difference?
9
Match Each Structural Pattern to Its Intent
10
Duck Typing Often Makes Adapters Unnecessary
Objectives
Implement the Adapter pattern to reconcile incompatible interfaces
Apply a Facade to simplify a complex subsystem
Build a Composite tree for uniform treatment of leaves and containers
Explain where duck typing reduces the need for explicit adapters
Chapter 20 · Design Patterns in Python
Creational Patterns
Structural Patterns
Behavioral Patterns
Pythonic Patterns & Anti-Patterns
Previous: Creational Patterns
Next: Behavioral Patterns