The SOLID design principles
What are they?
- SRP: The Single Responsibility Principle
- OCP: The Open-Closed Principle
- LSP: The Liskov Substitution Principle
- ISP: The Interface Segregation Principle
- DIP: The Dependency Inversion Principle
KNOWLEDGE GAP - LEARNMORE
Single Responsibility Principle
https://stackify.com/solid-design-principles/
Open Closed Principle
https://stackify.com/solid-design-open-closed-principle/
Liskov Substitution Principle
https://stackify.com/solid-design-liskov-substitution-principle/
The principle defines that objects of a superclass shall be replaceable with objects of its subclasses without breaking the application. That requires the objects of your subclasses to behave in the same way as the objects of your superclass. You can achieve that by following a few rules, which are pretty similar to the design by contract concept defined by Bertrand Meyer.
https://en.wikipedia.org/wiki/Circle%E2%80%93ellipse_problem is a violation of Liskov Substitution Principle
Interface Segregation Principle
https://stackify.com/interface-segregation-principle/
Clients should not be forced to depend upon interfaces that they do not use.
Dependency Inversion Principle
https://stackify.com/dependency-inversion-principle/
https://springframework.guru/solid-principles-object-oriented-programming/ https://www.geeksforgeeks.org/solid-principle-in-programming-understand-with-real-life-examples/?ref=leftbar-rightbar