Skip to content

SOLID

SOLID is mnemonic for group of good practices related with object oriented programming.

  • Single responsibility principle
  • Open-closed principle
  • Liskov’s substitution principle
  • Interface segregation principle
  • Dependency inversion principle

Single responsibility principle

Class should be responsible for one and only function.

Open-closed principle

Class should be open for extension and closed for modification.

Liskov’s substitution principle

All subclasses should be compatible with contract defined by superclass.

Interface segregation principle

Component should provide minimal required public interface.

Dependency inversion principle

Components should depend on abstraction instead of concrete implementation.