Back to Java Users Group Home Print this page

Java Users Group

November 2005 Meeting Information

November 8, 2005
Decorating Your Java Objects

This month's meeting will be an in-depth review of the Decorator design pattern. Design patterns are "simple and elegant solutions to specific problems in object-oriented software design." 1 The Decorator pattern attaches additional responsibilities to an object dynamically, and provides an alternative to subclassing for extending functionality. The overuse of subclassing can lead to class explosion and the need to add functionality inside a base class that may not be appropriate for some its subclasses. Decorator extends an object's behavior through composition, i.e, a decorator object that has-a component object it wants to decorate.

Decorator UML Diagram

1 Erich Gamma...[et al.]. Design Patterns - Elements of Reusable Object-Oriented Software, 1995