Medium Observer Design Pattern I think a lot of people will agree with me that the observer design pattern is one of the easiest design patterns. I mean, unlike the other design patterns, you can at least ‘feel’ what the main concept is when you first read about it. “The observer pattern is a software… Continue reading Observer vs Pub-Sub Pattern
Category: Design Pattern
Visitor Design Pattern
Link Intent Represent an operation to be performed on the elements of an object structure. Visitor lets you define a new operation without changing the classes of the elements on which it operates. The classic technique for recovering lost type information. Do the right thing based on the type of two objects. Double dispatch Problem… Continue reading Visitor Design Pattern
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: Bridge Pattern
Github. Paid Video Bridge is a structural design pattern that lets you split a large class or a set of closely related classes into two separate hierarchies — abstraction and implementation—which can be developed independently of each other. Dzone. Decouple an abstraction from its implementation so that the two can vary independently. Real world… Continue reading Design Pattern: Bridge Pattern
Design Pattern: Prototype
Link The Prototype Pattern The Prototype pattern is known as a creational pattern, as it is used to construct objects such that they can be decoupled from their implementing systems. The definition of Prototype as provided in the original Gang of Four book on DesignPatterns states: Create objects based on a template of an existing object through… Continue reading Design Pattern: Prototype
Design Pattern: Builder
Link Builder Real world example Imagine you are at Hardee's and you order a specific deal, lets say, "Big Hardee" and they hand it over to you without any questions; this is the example of simple factory. But there are cases when the creation logic might involve more steps. For example you want a customized Subway deal,… Continue reading Design Pattern: Builder
Design Pattern : Factory Pattern
Video This is a Creational Pattern. There are 3 kind of Factory Pattern - 1. Simple Factory 2. Factory Method 3. Abstract Factory Simple Factory The Simple Factory isn’t actually a Design Pattern; it’s more of a programming idiom. Real world example: Consider, you are building a house and you need doors. You can either put… Continue reading Design Pattern : Factory Pattern
Design Pattern
** Overview of all Design Pattern (Link) Composition is has a relationship and Inheritance has a is a relationship. It should be pretty clear that reducing dependencies to concrete classes in our code is a “good thing.” In fact, we’ve got an OO design principle that formalizes this notion; it even has a big, formal… Continue reading 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
You must be logged in to post a comment.