2.) Create an abstract Decorator class that extends the superclass of the objects you wish to decorate
3.) Create wrapper classes that extend the decorator class. The constructor should take a reference to the object the class is to wrap so that you can use the methods in all layers of the decorated classes
4.) Define any methods from the abstract class
5.) To wrap an object up in a decorator, all you have to do it assign it to your decorator and pass it into the constructor.
No comments:
Post a Comment