<<< Decorator Sample     Index     Decorator Benefits and Disadvantages  >>>

37. Decorator Sample, cont.


    Decorator UML Class Diagram
  • The Decorator maintains reference to the VisualComponent, and serves as a node of a singly-linked list of all visual components.

  • The BorderDecorator and ScrollDecorator are Concrete Decorators, which

    1. Add extra responsibilities to the visual component

    2. Forward requests to the abstract Decorator. The Decorator class further communicates window requests (such as Draw and Resize) to the next visual component on Decorator's list.


<<< Decorator Sample     Index     Decorator Benefits and Disadvantages  >>>