Sobes.tech
Middle

Briefly, tell five principles of SOLID.

sobes.tech AI

Answer from AI

  • S (Single Responsibility Principle) — a class should have only one reason to change, meaning it should perform only one task.
  • O (Open/Closed Principle) — software entities should be open for extension but closed for modification.
  • L (Liskov Substitution Principle) — objects of subclasses should be interchangeable with objects of the superclass without breaking the logic.
  • I (Interface Segregation Principle) — it is better to have several specialized interfaces than one universal interface.
  • D (Dependency Inversion Principle) — upper-level modules should not depend on lower-level modules; both should depend on abstractions.