Wednesday, January 5, 2011

Decorator Pattern

This is the most simple design pattern of all the patterns. Decorator patterns is nothing but its implementation of inheritance concept in object oriented model. They fall under the structural category of pattern types as they help in organizing the design of various objects, classes in the project structurally.

You have a class called MyClass and it has a method called Something() defined in this class. Now you also have a class called MySubClass that is inherited from MyClass. So you add another method called SomethingMore() in this inherited class to add something more to base implementation Something().

Therefore this pattern simply suggests using and encouraging the concept of inheritance, that’s all there is to this pattern.

Until next post….Keep thinking….

No comments:

Post a Comment