SOLID principles represent a set of principles that, if implemented properly should improve our code significantly.
As with any other principle in life, we can misuse and overuse every SOLID principle to the point of being counterproductive. Instead of getting an understandable, maintainable, and flexible code, we could end up with the code that’s in worse shape than without SOLID.
So, careful consideration and implementing these SOLID principles only where needed is the key to a clean codebase.
SOLID is a mnemonic acronym and each of the letters in it stands for:
- S – Single Responsibility Principle
- O – Open/Closed Principle
- L – Liskov Substitution Principle
- I – Interface Segregation Principle
- D – Dependency Inversion Principle
The source code for this series of articles can be found in this GitHub repo. You can switch to different branches to get to the different parts of the series.
We hope these articles will help you discern when and how to implement these principles the right way.