After multiple years of experience in the software development sector it becomes clear that the principles of object oriented programming are often misused, not correctly applied or simply just ignored by many developers.
Even if the basics seem to be easy, there are often big problems in their realization which may lead to:
- Bad code structure
- Unmaintainable code
- Bad performance
- Code that is just not understandable
The S.O.L.I.D. design principles that help to prevent all of these problems and allow the writing of high quality code are:
- Single Responsibility Principle
- Open-Closed Principle
- Liskov Substitution Principle
- Interface Segregation Principle
- Dependency Inversion Principle
I am going to present and explain each of these principles in detail. I am also going to show examples in C# that will help you to understand how to apply them in your code.