Attach additional responsibility to an object dynamically. Dcorators provide flexible alternative to subclassing for extending functionality.
Also Know As : Wrapper
Sometimes we want to add responsibilites to individual objects, not to an entire class.
- To add responsibilties to individual objects dynamically and transparently, that is without affecting other objects.
- For responsibilities that can be withdrawn.
- When extension by subclassing is impractical.