Chapter 3. Decorator Pattern
Design Principle
- Classes should be open for extension, but closed for modification.
Decorator Pattern
The Decorator Pattern attaches additional responsibilities to an object dynamically. Decorators provide a flexible alternative to subclassing for extending functionality.