Nov 3, 2018

Decorator Pattern

Decorator Pattern is one of the famous Gang of Four (GOF) structural design pattern, which provides an alternative way  of extending an object's functionality. It's different than traditional way of adding new functionality into object using Inheritance, since it's based on Composition and provides additional functionality at run time, as opposite to Inheritance, which adds new functionality at compile time. Decorator design pattern is introduced by famous Gang of Four design pattern book, almost 2 decades ago. It's a time tested way of adding new functionalities into object.