Understanding design patterns and their purpose
A design pattern is an admitted best practice to tackle a common problem. Many applications face the same challenges, as follows:
- They must be performant.
- They must be testable.
- They must be maintainable and should be able to grow over time.
- They must be portable to some extent.
- They must manage memory and the central processing unit (CPU) efficiently.
- They must be able to scale.
- They must support concurrency (thread safety).
The preceding list is only a subset of typical cross-cutting concerns. The purpose of a design pattern is to find the best approach to handle a common problem, regardless of whichever programming language is used.
Design patterns are inspirational and are not especially prescriptive about how the detailed implementation should be done. Design patterns remain high-level, and they aim to improve code quality as well as to ultimately adhere to the SOLID principles, a widely...