cloud-hail-mixedSolid Design Principles

The SOLID principles are five design principles that help make software more maintainable, scalable, and easier to understand. They are essential for writing clean, modular, and testable code.

Single Responsibility Principle (SRP)

The Single Responsibility Principle states that a class should have only one responsibility but not more than that. Simple a class should have one reason to change.

Open/Closed Principle (OCP)

Objects or entities should be open for extension but closed for modification.

Liskov Substitution Principle (LSP)

Derived classes must be substitutable for their base classes. Says that codes that work with parent classes or interfaces should not break when those classes are replaced with child classes or interface-implementing classes.

Interface Segregation Principle (ISP)

A client should never be forced to implement an interface that does not use or does not depend on methods they do not use.

Dependency Inversion Principle (DIP)

Higher-level modules should not depend on lower-level ones. Both should depend on abstraction.

Last updated