Crea sito

Why do we use design patterns?

There are two ways of doing code: own creative code and structured code. The first one is a solution that represents you in a single context where you are the only one developer of a project. The second way refers to a context that involves one or more people and that allows developers to communicate and talk through common structures.

Design patterns are refined, secure and studied ways to solve common problems that can arise in the developer life: expecially in an object oriented context.

Using them, you'll be able to become a more professional programmer that can talk with others in a known language.

A solid way of thinking code

I think that all programmers, those start to develop their first applications, do many errors not only in code but in the structure of code, that grows more complex and labirithic.

From those bad habits, design patterns have grown in the last decades to simplify code lines and create solid structures those make your application more flexible and maintainable.

Some examples

  • maintain a global variables into your application (db connection pool)
  • create a subscriber that do some things when a particular event occurs
  • filter illegal actions allowing access only to correct actions
  • split graphic layer from engine (MVC)
  • ....etc