One of the most important things when speaking about OOP is design patterns. But what are design patterns? A design pattern is a universal, tested-in-practice guide for frequently occurring, repetitive design issues.
Design patterns are a description of a solution, not the implementation of a solution.
Design patterns can be described using four basic elements:
- The name of the pattern
- Problem: How to recognize situations when we should use a particular pattern to ensure the use of a pattern is justified
- Solution: Describes elements of a solution, their relations, connections, and duties
- Consequences: A list of advantages and disadvantages of a pattern
Design patterns can be divided into three sets according to their purpose:
- Creational: Describes the process of creating a new object, the initialization, and the configuration of objects...