S.O.L.I.D. Principles
- ANIL FIRAT
- 13 Nis 2020
- 1 dakikada okunur
In this article I want to briefly go through SOLID principles (acronym that stands for five basic principles of object-oriented programming and design) supplying each of them with real-world visual examples to make those principles more understandable, readable and memorisable.

S — Single Responsibility Principle
A class should have only a single responsibility. Only one potential change in the software’s specification should be able to affect the specification of the class.
O — Open/Closed Principle
Software entities should be open for EXTENSION, but closed for MODIFICATION. Allow behaviour to be extended without modifying the source-code.
L — Liskov Substitution Principle
Objects in a program should be replaceable with instances of their subtypes without altering the correctness of that program.
I — Interface Segregation Principle
Many client-specific interfaces are better than one general-purpose interface. No client should be forced to depend on methods it does not use.
D — Dependency Inversion Principle
One should depend upon abstractions, not concretions.
High-level modules should not depend on low-level modules. Both should depend on abstractions.
Abstractions should not depend on details. Details should depend on abstractions.
Hope It will be easy to understand for you :)
Comments