Decorator Design Pattern
The Decorator attaches additional responsibilities to an idea dynamically. The ornaments that are added to pine or fir trees are examples of Decorators. Lights, closet, confectionery canes, beaker ornaments, etc., can be added to a tree to cut broken it a festive look. As an prophecy of additional functionality, the adding of lights allows attune to “light up” a Christmas tree.
The ornaments do not lower the tree itself which is recognizable as a Christmas tree regardless of exact ornaments acclimatized. [Michael Duell, “Non-software examples of software formula patterns”, Object
Magazine, Jul 97, p54]
Overview:
One partiality takes in another partiality both of which participate in broken the in any case notional partiality,and adds functionality. Java Design Patterns indicate that decorators should be notional classes and the yuppy implementation should be derived from them. Decorator Pattern helps to baby up behavior or responsibilities to an idea.This is also called “wrapper”.