SOLID Principles contain the first 5 principles of Object-Oriented Programming

SOLID Principles

Single-Responsibility Principle (SRP)

  • a class should have a single responsibility

Open-Closed Principle (OCP)

  • objects or entities should be open for extension but closed for modification

Liskov Substitution Principle (LSP)

  • every subclass or derived class should be substitutable for their base or parent class

Interface-Segregation Principle (ISP)

  • a client should never be forced to implement an interface that it doesn’t use, or clients shouldn’t be forced to depend on methods they do not use

Dependency-Injection Principle (DIP)

  • entities must depend on abstractions, not on concretions. It states that the high-level module must not depend on the low-level module, but should depend on abstractions
  • allows for decoupling