This pattern makes use of a base and a decorator that wraps around that base. With a reference to the base, the decorator can do something with the base value and then return it ‘decorated’
- Make Get Call
- Review the results
According to reference #1, the actors are:
- Component/Decorator Base
- Component Base – This is the ‘non-decorated’ component. For my implementation, this is AbsBase.js.
- Decorator Base – This is a composite object that takes the base and modifies it. For my implementation, this is AbsDecoratorBase.js.
- Concrete Base/Concrete Decorator Base – These are the implementations. For my implementation, I created objects in decoratorDriver.js.