
S-> Single Responsibility
O-> Open/Closed Principle
L-> Liskov's Substitution Principle
I-> Interface Segregration
D-> Dependency Inversion
__________________________________________________________________________________________________________________________________________________________________________________________________________

Class Should have a Single Responsivility or Purpose.
Accurate Defination: A class Should have only one reason to change.

__________________________________________________________________________________________________________________________________________________________________________________________________________

We should able to extend a class behavior without modifying it.
Accurate Defination: Software entities should be open for Extension, but closed for modification.
__________________________________________________________________________________________________________________________________________________________________________________________________________

class x is a subtype of class y
Then we should be able to replace y with x without interrupting the behaviour or logic of code.
Accurate Defination: Derived or child classes must be substitutable for their base or parent classes.
This principle shows that polymorphism is both powerful and tricky : in the real world, the usage of polymorphism often leads to a dead-end situation, it must be wisely used.
LSP is often summarized with a counter-example of Duck Test: “If it looks like a duck, quacks like a duck, but needs batteries – you probably have the wrong abstraction”

__________________________________________________________________________________________________________________________________________________________________________________________________________

This principle applies to interfaces instead of classes in SOLID.
Accurate Defination: Do not force any client to implement an interface which is irrelevant to them.
__________________________________________________________________________________________________________________________________________________________________________________________________________

Note: Dependency Inversion != Dependency Injection
Use abstract classes and interfaces instead of concrete implementation.
Accurate Defination: High-level modules should not depend on the low-level module but both should depend on the abstration.

Coding Example :
Let's begin with one coding example
__________________________________________________________________________________________________________________________________________________________________________________________________________


