Thursday, September 25, 2014

Not so SOLID principles

SOLID principles appeared around year 2000 by Robert C. Martin aka. "Uncle Bob". They were principles, if followed by developer, would result in software, that is maintainable and extensible. Since then, they gained lots of popularity and recognition. I can see them being mentioned on Programmers all the time. And I do think that they are good thing to know and use.

But, as all things, those principles are not without problems. One of those problems is that they are ambiguous in their description. This leads to misrepresentation of what they really mean and how they should be used. This is why some of the principles have multiple definitions, as people tried to be more specific about it. This is also why I believe those principles are good guidelines, but they should not be followed rigorously.

The following posts will go over each of the five popular principles, in which I will try to explain possible problems with their understanding and how I understand them.

The principles are :

  • Single responsibility principle
  • Open/Closed principle
  • Liskov Substitution principle
  • Interface segregation principle
  • Dependency inversion principle