What is S.O.L.I.D?

What is S.O.L.I.D?

Asliddin Eshonkulov

This is nothing but a set of principles that helps us to design our classes.Let's learn what each letter stands for:


S - Single Responsiblity

It means whenever you create a class or interface it should be responsible for one particular thing.


O - Open/Closed

Open for extention (new features), closed for modification (change).


L - Liskov Substitution

Imagine we have a class B which is a subclass of class A. With liskov substitution principle i should be able to call any method with argument class B that requires argument class A.


I - Interface Segregation

Another word this is nothing but interface seperation.While developing projects we should make sure that one interface is not doing everything, rather we should seperate them.


D - Dependency Inversion
Our project should depend on interfaces and abstract classes rather than concrete classes.




Report Page