What is solid object-oriented design? Like, strong, steady, you know or not a liquid or something? Well, who knows? Unless it’s written in CAPITALS! In that case it’s a acronym introduced by Robert C. Martin in the early 2000s which stands for five basic principles of object-oriented programming and design. What are these principles?
- SRP – Single responsibility principle
- OCP – Open/Closed principle
- LSP – Liskov substitution principle
- ISP – Interface segregation principle
- DIP – Dependency inversion principle
The principles (or guidelines), when applied together intend to make it more likely, that a programmer will create a system, that is easy to maintain and extend over time. These guidelines are here simply to make our lives a little easier. They’re certainly not to be followed religiously (including laying a fierce wrath upon anyone who dares to break them). If you find out, that your design abides them, good for you! If it doesn’t and you know the reason why, it’s no problem either :-).
I find them very helpful, especially when it comes to evaluating my work and that’s why I decided to take a break from design patterns for a while and go through the** SOLID** set of principles first.