When is it necessary to use the decorator pattern? If possible, give me a real world example that is well-suited for the pattern.
From Gang of Four:
A graphical user interface toolkit, for example, should let you add properties like borders or behaviors like scrolling to any user interface component.
...
The decorator conforms to the interface of the component it decorates so that its presence is transparent to the component's clients. The decorator forwards requests to the component and may perform additional actions (such as drawing a border) before or after forwarding. Transparency lets you nest decorators recursively, thereby allowing an unlimited number of added responsibilities.