Decorator Pattern
Solution
- Define an interface type that is an abstraction for the component
- Concrete component classes realize this interface type.
- Decorator classes also realize this interface type.
- A decorator object manages the component object that it decorates
- When implementing a method from the component interface type, the
decorator class applies the method to the decorated component and
combines the result with the effect of the decoration.