SE450: Decorator Pattern [49/72] Previous pageContentsNext page

Solution

  1. Define an interface type that is an abstraction for the component
  2. Concrete component classes realize this interface type.
  3. Decorator classes also realize this interface type.
  4. A decorator object manages the component object that it decorates
  5. When implementing a method from the component interface type, the decorator class applies the method to the decorated component and combines the result with the effect of the decoration.

Previous pageContentsNext page