SOLID
Principles for Robust and Maintainable Code
S Single Responsibility Principle
O Open-Closed Principle
L Liskov Substitution Principle
I Interface Segregation Principle
D Dependency Inversion Principle
Jihene Labidi
Single Responsibility Principle
A class should have only one responsibility.
Jihene Labidi
Open-
pen-CClosed Principle
A class should be open for extension but closed for modification.
Jihene Labidi
Liskov Substitution Principle
Derived classes must be substitutable for their base classes.
Jihene Labidi
Interface Segregation Principle
Clients should not be forced to depend on interfaces they don’t use.
Jihene Labidi
Dependency IInversion
nversion Principle
High-level modules should depend on abstractions, not on concretions.
Jihene Labidi