SOLID Principles

SOLID is an acronym for five design principles for object oriented code, although SOLID can be used and adapted as principles for any form of software development.

The term SOLID was introduced by Robert C. Martin, and it's considered to be the base principles which its violation can cause many problems that can be solved using one of the design patterns widely known (of course not every form of violation can have a solution in a form of a design pattern).

To fully understand the design patterns, why are they made? and what problems do they solve? you should first fully grasp the five SOLID principles:

After applying the SOLID principles to your code base, the code should be decoupled, easy to reuse, easy to extend (as we are always looking for low coupling, and high cohesion), but be aware of over-engineering without a clear vision of why you're choosing to follow these principles, by the end of the day they're only principles, not rules, they can be ignored in some cases for clear reasons and better solutions.

Last updated