SOLID Principles
Hi everyone! In this week, we'll talk about SOLID principles. So let's get to it.
The first principle called "Single Responsibility Principle" is one of the easiest to understand but at the same time one of the hardest to apply. To get a class to have only one responsibility, there has to be a very good software design, but developers must also devote time to code analysis (especially those that are dedicated to maintenance). Otherwise, programmers will simply do what is faster and simpler: Add code wherever it is going to work (Apparently) what was requested by clients.
The principles with which I do not agree at all are "Open / Closed Principle" and "Liskov Substitution Principle" since I believe that the base classes should have the flexibility to be modified as long as the repercussions of the modification are understood. On the other hand, I think that classes must certainly be made to be extended or replaced by functions, since in this way it is easier to add future changes without having to analyze too much (which is quite useful when delivery times are very limited).
The principle called "Interface Segregation Principle" seems very true to me. I think it is very important to keep the code in small fragments so that they are understandable and reusable at the same time without wasting resources (unnecessary code fragments).
Finally, I believe that "Dependency Inversion Principle" is extremely important for static typing languages since by using this tool, the dependency between the concrete classes is minimized.
Comentarios
Publicar un comentario