DEV Community

Captain Iminza
Captain Iminza

Posted on

SOLID PRINCIPLES

SOLID PRINCIPLES
SOLID is an Object Oriented Design principle
SOLID is more about how you design your application or microservice internal layers and about decoupling dependencies between them.
It is an essential design principle for every developer.
The SOLID principle is an acronym that stands for;
S- Single Responsibility principle
Here, you should always create a class that has just one responsibility. if your class is to get the list of users, let it stick to this alone, don't try to introduce so many tasks into one single class. There should never be more than pone reason for a class to change.
O- Open-closed principle
This means that software entities should be open for extension and closed for modification. Always ensure that you write codes that are extendable where new features can be added rather than modifying the existing code every time.
L-Liskov Substitution principle
Subtype objects should be substitutable for supertype objects.
This extends the Open/Closed Principle by focusing on the behavior of a superclass and its subtypes. Ensure all properties of the supertype are passed to the subtype object to avoid disrupting the behavior of our App. Functions that use pointers or references to base classes must be able to use objects of derived classes without knowing it.
I- Interface segregation principle
Clients should not be made to depend on interfaces that they don't use.
D- Dependency Inversion
One entity should depend on abstractions and not concretions.

REFERENCE
https://www.freecodecamp.org/news/solid-principles-explained-in-plain-english/

Top comments (0)