🔥 SOLID PRINCIPLES 🔥

avatar-sm Bhushan Gaikwad published 3 months ago... 1 min read
SOLID-PRINCIPLES

First of all, It is an acronym.

S => Single Responsibility Principle

O => Open Close Principle

L => Liskov Substitution Principle

I => Interface Segregation

D => Dependency Inversion

So let’s dig in to the SOLID principles at a glance.


Single Responsibility:

A Class should be responsible for a single task.


Open-Close Principle:

A Class should be open to extension and close to modification.


Liskov Substitution:

A derived Class can be substituted at places where base Class is used.


Interface Segregation:

Don’t make FAT Interfaces. i.e. Classes don’t have to override extra agreements that are not needed for that Class simply because it is there in interface.


Dependency Inversion:

Depend on abstractions, not on concretions. Not only high level Classes but low level Classes also depend on the abstractions in order to decouple the code.