Decorator


This is a pattern that allows you to attach new behaviours to an object.

A Component declares a common interface for the object to be wrapped and the wrapper.
The concrete Components are the objects with the basic behaviour.
The Decorator contains a wrapped object. It delegates all its operations to the wrapped object.
Concrete Decorators define new behaviours that can be added.

The client can use multiple Decorators assembled.

Applicability

META

Status:: #wiki/notes/germinating
Plantations:: Structural Patterns
References:: Dive Into Design Patterns