domingo, 6 de octubre de 2019

Understanding the SOLID principles

SOLID principles are a very simple way to remember the good practices that any object-oriented programmer should consider. Each of the principles attacks a specific point that affects the way in which a programmer defines the objects within a program, how they will interact, how they can be used, their capabilities, and so on.
I consider that both the acronym is very consistent with what it refers to because the idea is to create robust, resistant to change, robust applications.
The 5 SOLID principles are:
- Simple Responsibility: That refers to a class or object should only attend a specific task, it is the decision of each programmer how specific these activities should be, but intentions should not be mixed.
- Open / Closed: It means that classes or objects must be open to extension, but closed for modification, so that the behavior of a defined class cannot be altered.
- Liskov Substitution: It means that a class that inherits from another must be interchangeable for a function that requires the base class, that is, it can be substituted.
- Interface Segregation: It means that the interfaces must be simple and simple, not have more than necessary. In case an interface becomes very complex, it must be divided so that the classes that implement them do not have empty methods that are not used.
- Dependency Inversion: Refers to avoid dependence between 2 classes from the implementation of an interface instead of a class when it is required to use.
Taking these principles into account when programming the systems will allow for greater ease of maintenance of the applications and will make them scalar without having to pay too much work to the people who do this maintenance. It is important to consider the principles not only because they are good practices, but because they will make the systems of higher quality, reusable and scalable.

No hay comentarios:

Publicar un comentario