[EN] Design Patterns Series
- 1 minLet’s understand what it’s design patterns first :)
Design Patterns
The Design patterns concept was introduced by GoF (Gang of Four) on the book Design Patterns: Elements of Reusable Object-Oriented Software. Design Patterns are solutions for certain software problems.
The book shows 23 design patterns and they are classified into 3 categories.
Classification
- Creational pattern;
- Structural pattern;
- Behavioral pattern;
Creational Pattern
It provides object creational mechanisms to rise the code flexibility and reusability, such as:
- works with the base on the mode the objects can be created;
- isolates the object creation details;
- the code is independent of the object type to be created.
Example: Singleton
Structural Pattern
It provides how to assemble objects and classes into larger structures, while still keeping flexible and efficient structures, such as:
- determines the design of objects and class structures to be composed and to reach a wide result;
- the focus is to simplify the structure and identify the relationship between classes and objects
- it focuses on heritage and class composition;
Example: Adapter
Behavioral Pattern
It ensures efficiet comunication and identification of responsability between objects, such as:
- it’s concerned about the interaction between objects and their responsibilities;
- the objects might be able to interact and therefore, they have to have loose coupling
Example: Observer
Thank you for reading <3