Ok, time for a structural pattern. I really like the Decorator pattern idea. Basically you create an abstract base class, Component. This you subclass to create concrete components, AND, to create Decorators. The decorators add functionality to the concrete components, and since they all subclass the abstract components you can add several decorators, add just the functionality you need.
As with the previous patterns I have added example code in my repository on GitHub.
As with the previous patterns I have added example code in my repository on GitHub.
Kommentarer
Skicka en kommentar