In software engineering, a software design pattern is a general, reusable solution to a commonly occurring problem within a given context in software design.
Before diving into design patterns, it's important to mention GoF. What is a Gang Of Four?
The Gang of Four are the authors of "Design Patterns: Elements of Reusable Object-Oriented Software". The book was released in 1994 and still to this date it resonates with software developers.
It’s an important book describing twenty-three Object-Oriented Design Patterns & various development techniques. The four authors are:
Erich Gamma
Ralph Johnson
John Vlissides
Richard Helm
In software engineering, a software design pattern is a general, reusable solution to a commonly occurring problem within a given context in software design. Design patterns are concepts used to solve recurring software engineering problems.
Why do we need to know Design Patterns?
Design patterns can speed up the development process.
Design patterns are a toolkit of tried and tested solutions to common problems in software design.
Design Patterns provide easy-to-recognize and use OOP solutions to common problems.
Design patterns define a common language that you and your teammates can use to communicate more efficiently.
Types of Design Patterns
GoF has classified design patterns into three categories below.
Creational Design Pattern
Structural Design Pattern
Behavioral Design Pattern
Let's try to understand these three design patterns.
Creational Design Pattern
The first design pattern is the creational pattern. These design patterns deal with the creation of an object. It provides ways to instantiate single objects or groups of related objects.
Structural Design Pattern
The second type of design pattern is the structural pattern. The design patterns in this category deal with the class structure such as Inheritance and Composition. It provides a manner to define relationships between classes or objects.
Behavioral Design Pattern
The third type of design pattern is the behavioral pattern. This type of design pattern provides the solution for better interaction between objects, how to provide loose coupling, and flexibility to extend easily in the future.
Comentarii