What are S.O.L.I.D Principles?

What are S.O.L.I.D Principles?

S.O.L.I.D Principles Series

The solid principles were developed by Robert C.Martin and It consist of five object-oriented design principles which help us to write clean and maintainable code. The "S.O.L.I.D" abbreviation represents:

Single Responsibility Principle (SRP): There should only be one cause or reason for a class to change, which translates to a single responsibility or purpose.

Open/Closed Principle (OCP): Classes should be open for extension but closed for modification, so that simple updates can be made without changing the existing code.

Liskov Substitution Principle (LSP): Objects of a superclass should be interchangeable with those of its subclasses without compromising the program's functionality.

Interface Segregation Principle (ISP): To prevent bloat and maintain cohesiveness, interfaces should be unique to the implementing class and contain only the methods that are absolutely necessary.

Dependency Inversion Principle (DIP): To enable flexibility and scalability, high-level modules should not rely on low-level modules; rather, they should both rely on abstractions.

The goal of the S.O.L.I.D. principles is to improve the readability, flexibility, and maintainability of software designs.

See you in the next article of this series.