What is Decorator Design Pattern ?
Intent
- Attach additional responsibilities to an object dynamically.Decorators provide a flexible alternative to subclassing for extending functionality.
- Client-specified embellishment of a core object by recursively wrapping it.
- Wrapping a gift, putting it in a box, and wrapping the box.
Problem
You want to add behavior or state to individual objects at run-time. Inheritance is not feasible because it is static and applies to an entire class.Why to read, you can just watch the below videos to understand Decorator Design pattern and its implementations and share your comments ?
