So design patterns are one of those language-agnostic concepts you’d come across as a software engineer. They’re basically more reusable solutions to common problems. A good understanding of these design patterns would make it easier to develop more suitable solutions to most problems you’d try to solve as a software engineer.
While building software, there are some problems repeated quite often, and having to rewrite the same code a whole lot of times, to achieve the same thing would not be the most optimal approach, hence the need for packages. In the same vein, many of the problems you’d have to solve have similar patterns that make it easier to approach, and this is why design patterns were created. It’s basically a bunch of tested guidelines that always solve similar problems pretty well.
If you’ve built any software, you’ve probably encountered some of the most common patterns, but a more broad understanding of each design pattern and its use case would help come up with more clever solutions.
Design Patterns are broadly classified into three:
- Structural,
- Behavioral, and
- Creational design patterns.
- Structural design patterns refer to the patterns that suggest approaches commonly used to compose various classes/objects in solving a problem.
- Behavioral design patterns refer to the patterns that help to solve problems related to interactions between various classes/objects.
- Creational design patterns refer to the patterns that suggest approaches commonly used to create objects from a class, based on the behavior required by the object.
Click this for the source