Factory Pattern
Factory Pattern

The Factory method pattern defines an interface in terms of contract for creating an object but let’s subclasses decide which classes to instantiate. Factory method lets the class differ instantiation to sub classes. It says that when you are about to instantiate let’s encapsulate that instantiation so that we can make it uniform across all... » read more

Proxy Pattern
Proxy Pattern

Proxy Pattern provides a surrogate or placeholder for another object in order to control access to it. You have an object that you want to get access to on which you want to invoke methods on and somehow interact with it but instead of being allowed to interact with that object you have a proxy... » read more

Facade Pattern
Facade Pattern

Façade Pattern The word Façade in general context indicates the exterior of the building hiding the interior complexity. In the similar fashion it is used to hide the complexity of interactions across multiple classes by providing an outer façade which interacts with these classes.  Client calls Façade which handles the complex interactions instead of client... » read more

Adapter Pattern
Adapter Pattern

Adapter pattern is a structural design pattern which is used for making two interfaces compatible which otherwise were incompatible. It is commonly referred to as wrapper pattern. This can be best explained by considering a simple 1-1 adapter. Below is an adapter which has provision for two wire input and converts it to a 3-output... » read more

Dependency Injection
Dependency Injection

Dependency Inversion is the all-encompassing principle. Its states that dependencies need to be inverted. Dependency Injection is the specific act of inverting dependencies. Constructor Injection is when you are performing dependency injection through constructor of an object. Parameter Injection is when you perform dependency injection through parameter of any function of an object. Dependency Injection... » read more

Strategy Pattern
Strategy Pattern

Strategy pattern is mainly used for composition rather than inheritance. It defines a family of algorithms encapsulates each one and makes them interchangeable. Strategy makes algorithm change independently without client changing it. Strategy decouples algorithm from the client using it which means if I have to change the algorithm, I don’t have to change the... » read more