Decorator Design Pattern

Journaldev Decorator design pattern is used to modify the functionality of an object at runtime. At the same time other instances of the same class will not be affected by this, so individual object gets the modified behavior. Decorator design pattern is one of the structural design pattern (such as Adapter Pattern, Bridge Pattern, Composite Pattern) and uses abstract classes… Continue reading Decorator Design Pattern

Design Pattern: Singleton

Medium https://medium.com/@kevalpatel2106/how-to-make-the-perfect-singleton-de6b951dfdb0 What is the purpose of Singleton? The purpose of the Singleton class is to control object creation, limiting the number of objects to only one. The singleton allows only one entry point to create the new instance of the class. Since there is only one Singleton instance, any instance fields of a Singleton… Continue reading Design Pattern: Singleton

Strategy Pattern

Medium In Strategy Pattern, composition is used over inheritance. It is advised to program to abstraction than to concretions. You see that Strategy Pattern is compatible with the SOLID principles. Inheritance vs Composition Inheritance `is a` relationship. To avoid duplication. Have similar      functionality. Composition `has a ` relationship Strategy Pattern.  Youtube While inheritance is… Continue reading Strategy Pattern