Sobes.tech
Middle

What are SOLID principles?

sobes.tech AI

Answer from AI

A set of five object-oriented design principles aimed at creating more flexible, maintainable, and extendable code.

S - Single Responsibility Principle A class should have only one reason to change.

O - Open/Closed Principle Software entities (classes, modules, functions, etc.) should be open for extension but closed for modification.

L - Liskov Substitution Principle Derived classes should be fully interchangeable with their base classes. Objects in a program should be replaceable with instances of their subtypes without altering the correctness of the program.

I - Interface Segregation Principle Clients should not be forced to depend on interfaces they do not use. It is better to have many specific interfaces than a single general-purpose interface.

D - Dependency Inversion Principle High-level modules should not depend on low-level modules. Both should depend on abstractions. Abstractions should not depend on details. Details should depend on abstractions.