Decorator:Decorator Design pattern is part of Structural Patterns from Gang of Four(GOF) Design patterns.it is a widely used structural Pattern.It Dynamically adds the functionality to an object at runtime without affecting the other objects.It add further answerability to an object by Bundle it.
For Example Egg Amulet is the object which is already cooked and acknowledge as a primary object.As customer Request we need to add some optional toppings like sauce and onion on it,Primary is only for the object customer requested without effecting other Amulet.We can acknowledge these toppings as a optional responsibilities add by the decorator.
Important Points to Remember
Add and remove optional functionalities to an object actively at runtime without affecting the other Objects.
Generally these decorators are designed on component Interface,so we can select the object which has to be decorated at Runtime.
Manytime adding a extra responsibility to a class may not be possible by make child class it.Only available way of achieving it by using Decorator.
Following are the Part of Decorator Design Patter
1. Component-Amulet is the base interface
2. Concrete component-Normal baked Amulet is the material implementation of the amulet interface
3. Decorator-it is the abstract class which hold the reference pf the component and implement from the component.
4. Concrete Decorator-Who implement from the abstract decorator and add extra responsibility to Concrete component.

Atul GuptaPosted Feb 6, 2015, 5:01 AM
Good one, Great work sir........
Joginder BangerPosted Feb 3, 2015, 4:38 AM
SIR I READ ONE COMMENT ON STACKOVERFLOW P FOR PROGRAMMING....I LIKE IT...