Can you explain Decorator Pattern ?

 Posted by ArticlesMaint on 9/25/2009 | Category: Design Pattern & Practices Interview questions | Views: 3267

Decorator pattern allows creating inherited classes which are sum of all part of the parent. For instance figure ‘Decorator’ has class1 which has method called as ‘SomeFunction’ now we inherit and add one more method called as ‘SomeMoreFunction’. So Class2 is the addition of ‘SomeFunction’ plus ‘SomeMoreFunction’.

Figure: - Decorator

Asked In: Many Interviews | Alert Moderator 

Comments or Responses

Login to post response