Decorator pattern

The Decorator pattern attaches additional responsibilities to an object
dynamically. Decorators provide a flexible alternative to subclassing
for extending functionality.