Decorator Pattern
The Decorator Pattern is a structural design pattern used in software development to add new functionality to an object dynamically. It allows behavior to be added to individual objects without affecting the behavior of other objects from the same class. This is achieved by wrapping the original object with a new class that implements the same interface, thus enhancing its capabilities.
In this pattern, decorators can be stacked, meaning multiple decorators can be applied to a single object. This flexibility enables developers to create complex functionalities by combining simple components, promoting code reusability and adherence to the Single Responsibility Principle.