Design patterns you should know

Design patterns help us to create robust applications by solving common problems using known and proven solutions.

We identify something as a pattern when we solve a problem that occurs frequently using a common solution method.

This method of solution is possible to use every time the same problem occurs, turning this approach into a reusable design.

This helps save time by avoiding creating particular solutions for something that has been solved before.

A design pattern is a known way to solve a recurring problem.

This design thus becomes a template that has already been evaluated countless times, so we can trust that they have been tested.

However, we must remember that these templates are proposed to be used in our codes and some cases may require changes to adapt them, but the base of the template already summarizes much work.

Why reinvent the wheel if it works perfectly like this? The problem was analyzed and, this template has already been tested successfully before. If we use the code designs, you can not worry about unexpected results.

A good design allows maintenance without much difficulty because it is known and documented extensively. It facilitates any discussion and analysis that arises about the existing code and also improves the reading for new developers over the code.

How design patterns are classified

design pattern types

There are several types of patterns that can be very useful. Creational, structural, and behavioral. These are just some that I usually use and that I believe can not miss in our daily development routine.

Creational design patterns. Solve problems in instance creation.

In conclusion:

  • Design pattern, helps to unify the code developed between different programmers.
  • It helps to gain time applying known solutions to common problems.
  • Helps to create a readable and maintainable code in the future.
Hi! If you find my posts helpful, please support me by inviting me for a coffee :)

See also