Design Pattern
What is Design Pattern?
Design pattern are evolved as reusable solution to the problems that we encounter every day of programming. They are generally targeted at solving of object generation and integration. In other words, Design Pattern act as a templates that can be applied to the real-world problem.
Evolution of Design Pattern and GoF
The four authors of the book “Element of reusable Object-Oriented Software” are referred as Gang of Four.
The book is divided into two parts in which first part explaining about the Pros and Cons of Object Oriented Programming and the second part explaining the evolution of 23 classic software design patterns.
From then, Gang of Four design patterns has made a significant role in the software development life cycle.
Types of Design Patterns
There are 3 types of Design Patterns
Creational
This type deals with the object creation and initialization. This program makes the program more flexible and decide which objects need to be created for a given case.
- Example: Singleton, Factory, Abstract Factory.. etc.
Structural
This type deals with class and object composition. This pattern focuses on decoupling interface and implementation of class and its objects.
- Example: Adapter, Bridge.. etc
Behavioral
This type deals with communication between Classes and objects.
- Example: Chain of Responsibility, Command, Interpreter… etc
Types of Creational Design Pattern
- Factory Method Design Pattern
- Abstract Factory Method Design Pattern
- Singleton Method Design Pattern
- Prototype Method Design Pattern
- Builder Method Design Pattern
Types of Structural Design Pattern
- Adapter Method Design Pattern
- Bridge Factory Method Design Pattern
- Composite Method Design Pattern
- Decorator Method Design Pattern
- Facade Method Design Pattern
- Flyweight Method Design Pattern
- Proxy Method Design Pattern
Types of Behavioral Design Pattern
- Chain Of Responsibility Method Design Pattern
- Command Method Design Pattern
- Interpreter Method Design Pattern
- Mediator Method Design Pattern
- Memento Method Design Pattern
- Observer Method Design Pattern
- State Method Design Pattern
- Strategy Method Design Pattern
- Template Method Design Pattern
- Visitor Method Design Pattern