[SOLVED] What are the 5 SOLID principles ?

What is meant by solid principles ?

Solid Principles: Strong Principles is a coding standard that all developers can recognize in order to properly build apps and avoid bad design. Robert C. Martin popularized it, and it’s still used throughout the object-oriented design spectrum. It makes the code more extendable, logical, and easier to read when used correctly.

What are the 5 OOP principles ?

The following are the five concepts that make up SOLID principles :

  • Single Responsibility principle.
  • Open/Closed principle.
  • Liskov Substitution principle.
  • Interface Segregation principle.
  • Dependency Inversion principle.

How do you learn solid principles?

To grasp SOLID concepts, you must have a thorough understanding of how the interface is used. This document will help you if the interface definition is unclear. There should be just one justification for a class to move.

Single Responsibility

A class should have a single responsibility.


Classes should be open for extension, but closed for modification.


If S is a subtype of T, then objects of type T in a program can be replaced by objects of type S without altering any of the desirable properties of that program.

Interface Segregation

Prevent classes from using things they don’t need.

Dependency Inversion 

Abstractions should not depend on details. The details should depend on the abstractions.

High-level modules should not depend on low-level modules. Both should depend on abstraction.

So whats we must know , is In object-oriented computer programmingSOLID is a mnemonic acronym for five design principles intended to make software designs more understandable, flexible, and maintainable.

people found this article helpful. What about you?