Decorator

  1. Contrast the added flexibility of the Decorator pattern using object structure to the way in which the intention of Decorator can be achieved using class structure.
  2. Explain the pay-as-you go approach of Decorator for adding features to a class.
  3. Describe the implementation issues for having an abstract class at the top of the decorator hierarchy.
  4. Explain why the decorator and the concrete component must adhere to the same interface.  Describe the mechanism for extending the interface of the concrete decorators.
  5. Explain the problem with accessing extended functionality provided by all decorators in a chain.
  6. Draw sequence diagrams for operations performed through chains of decorators.
  7. Distinguish when Strategy vs. Decorator is the appropriate pattern to use.