WHAT & WHY ?
SOLID principles are the guidelines or standards which can help to develop a software codebase which is
- Easy to read and understand logically
- Easy to modify/change
- Easy to maintain
When we develop any software we create components like classes, interfaces, structs, functions etc, this SOLID principles give us a valid reason where and when to employ them.
And if we don’t use them our decisions for writing code for these entities will have arbitrariness. And when it comes to team everyone will be doing a code on their personal understanding, which will lead to the Design-Smelling as below.
Rigidity: The software is difficult to change. A small change causes a cascade of subsequent changes.
Fragility: The software breaks in many places due to a single change.
Immobility: You cannot reuse parts of the code in other projects because of involved risks and high effort.
SOLID is a subset of of five principles as below:
- Single Responsibility Principle
- Open-Closed Principle
- Liskov-Substitution Principle
- Interface Segregation Principle
- Dependency Inversion Principle