A Design pattern is a generic and reusable solution to a common software design problem. In other words, it is a template that provides a proven way to solve a particular type of problem in software design and its development. Design patterns help us create more flexible, maintainable, and efficient code for software development.
Types of Design pattern
The design patterns are divided into 3 major categories:
- Creational Design Patterns
- Structural Design Patterns
- Behavioral Design Patterns
Creational Design Patterns
Creational design patterns are those types of designs that are used to create objects according to the requirements in the best possible ways. Following are the examples of Creational design patterns:
- Singleton Design Pattern
- Factory Design Pattern
- Abstract Factory Design Pattern
- Builder Design Pattern
- Prototype Design Pattern
Structural Design Patterns
Structural design patterns concern the composition of classes and objects to form a larger structure while keeping these larger structures flexible and efficient. Following are the examples of Structural design patterns:
- Adapter Design Pattern
- Proxy Design Pattern
- Decorator Design Pattern
- Facade Design Pattern
- Bridge Design Pattern
- Flyweight Design Pattern
- Composite Design Pattern
Behavioral Design Patterns
Behavioral design patterns focus on how different objects communicate with each other while achieving loose coupling and flexibility in application development.
- Observer Design Pattern
- State Design Pattern
- Mediator Design Pattern
- Command Design Pattern
- Template Design Pattern
- Iterator Design Pattern
- Interpreter Design Pattern
- Memento Design Pattern
- Visitor Design Pattern