In real-world development, a software developer needs to understand the different issues they face in development. They need to understand and solve these issues by following some rules or patterns. One such set of rules is known as design patterns.
Patterns were originated by a civil engineer Christopher Alexander in 1977. In 1987, Kent Beck and Ward Cunningham started applying Christopher Alexander’s idea to the programming.
Patterns were popularized by a book named “Design Patterns – Elements of Reusable Object-Oriented Software” written by Erich Gamma, Richard Helm, and Ralph Johnson and John Vlissides; better known as Gang Of Four (GOF).
Design patterns help developers in identifying the common problems and provide a pre-defined way to solve these problems. Design Patterns provide some of the best practices to refactor a code from bad practice to good practice.
Patterns are a way to provide a solution for a well-known error or problem in an appropriate manner. GOF is generally known as the foundation for all the other patterns. All the patterns are divided into 3 Groups,
|S.No||Creational Patterns||Structural patterns||Behavioral Patterns|
|1.||Abstract Factory||Adapter||Chain of Response|
Creational design patterns are all about classes and objects. These patterns are also divided into class creation patterns and object creations patterns.
Structural Patterns provide a context to define the relationship between classes. It is all about the class and object composition.
These design patterns are concerned with communication between objects.
I hope that you understood what design patterns are and how many types of it there are. In the next article, we will discuss the different types of Design Patterns in detail.