posted 19 years ago
The Decorator pattern is a well known pattern written by the Gang of Four (GoF). You can find further information about this and other very useful patterns checking their book:
Design Patterns - Elements of Reusable Object-Oriented Software
Erich Gamma, Richard Helm, Ralph Johnson and John Vlissides
Addison Wesley
This pattern provide an alternative to subclassing for extending functionality, that is, you can add responsabilities to an object that can be withdrawn later without using subclassing. The decorator acts as a wrapper that forwards requests to the decorated object and may optionally perform additional operations before or after forwarding the request.
Regards,
Stefan
SCJP 1.4, SCBCD 1.3<br />IBM 141, 484, 486