Skip to content
uencoder

SOLID Principle

SOLID is the five-principle set for object-oriented design: Single Responsibility, Open/Closed, Liskov Substitution, Interface Segregation, and Dependency Inversion.

Purpose

Guide object-oriented design toward high cohesion and low coupling, improving maintainability and extensibility.

Mechanism

SRP: one responsibility per class. OCP: open for extension, closed for modification. LSP: subclasses must be substitutable for their parent. ISP: don't depend on interfaces you don't use. DIP: depend on abstractions, not concretions.

Use cases

  • Object-oriented design
  • Architecture principles
  • Code quality

References