Daily Term: Decorator Pattern
Decorator Pattern
The Decorator Pattern allows behavior to be added to objects dynamically by wrapping them in decorator classes, adhering to the Open/Closed Principle. For example, a coffee shop app might use decorators to add features like milk or sugar to a base coffee, each decorator modifying the cost and description. Decorators provide flexibility without modifying original classes, but they can lead to a proliferation of small classes and increased complexity.
Date: 2025-11-19