When to Use Decorator Pattern?
Add New Responsibility(functionality) to the class,without breaking the existing functionality.
Usage:
1.Component as abstract class/Interface.
2.Concrete Components Implementing the Components.
3.Decorator as abstract class/Interface with Component as member initialized via constructor.
4.Concrete Decorator Implements Decorator.
Consequence:
Functionality are added at runtime,Hard to debug(Since object implements both Concrete Component and Concrete Decorator).
Source Code:https://github.com/rangesh-/Design-Patterns/tree/master/Design%20Patterns/Decorartor%20Pattern