Design patterns are repeatable solutions to commonly occurring problems in software design. Design patterns should not be confused with complete software designs that can be transformed into code. A design pattern is more like a template for solving a problem, and this template can be used in different situations. Design patterns should also not be confused with algorithms. Even though both describe solutions to problems, a design pattern is more high-level. The code of the same design pattern can be written differently in different programs.
Design patterns
- help speed up the development process by providing tested and proven development paradigms (patterns).
- help prevent subtle issues that may cause major problems
- improve code readability for coders who are familiar with the patterns
- provide general solutions that aren't tied to a specific problem
- allow developers to communicate using well-known, well-understood names for software interactions
- We can describe the patterns using UML class diagrams
Design patterns are classified into 3 different types
- Creational design patterns - These patterns are concerned with class instantiation
- Structural design patterns - These patterns are concerned with class and object composition
- Behavioral design patterns - These patterns are concerned with the communication between objects.
The complete list of design patterns is very long and I will not be learning them all. This repo will contain examples and explanations of the design patterns that I have either used before or am learning for use.
Pattern | Type | Code Example |
---|---|---|
Factory Method | Creational | Factory Method |
Abstract Factory | Creational | Abstract Factory |