Dependency injection is one form of the broader technique of inversion of control (SOLID – Dependency inversion principles). In software, There should be less coupling between component and cohesion should be high. High level module should not depend on low level modules rather should depend on Abstraction.
Read MoreTag: software
Chain of responsibility design pattern
Introduction
In this article, we will talk about Chain Of responsibility design pattern. When we should use this design pattern and how you can implement it.
Type
Behavioral design pattern
Read MoreFacade design pattern
Type: Structural design pattern
Description:
‘Facade’ means ‘outward appearance‘
Lets take a simple example. When you visit any house, from outside its look really nice. Colorful walls, garden etc. But when you step in inside the house, you can see that all household items are not at their place. Some items are here and some items are there. There is full mess in the house. So just looking at the facade of the house, viewer would never know the internal structure of house, building blocks etc.
Read MoreFactory method design pattern
Type: Creational pattern
Description: Factory method design pattern allow you to create an object from one place instead of many places.
By implementing this design pattern, we are ensuring that we are abstracting the logic of object creation at one place only.
Read MoreTemplate method design pattern
Description:
This is a type of behavioral design pattern. There is an operation in a parent class which has few sub-tasks and all or few sub-tasks behavior may be changed by its child classes at run time.
It means we are defining a structure of an operation / algorithm and we are allowing child classes to implement their own behavior.
Read More