SOLID principle

  • single responsibility
    • there should never be more than one reason for a class to change.”[6] In other words, every class should have only one responsibility.
  • open close
    • open for extension
    • close for modification
  • liskov substitution
    • The Liskov substitution principle (LSP) states that “functions that use pointers or references to base classes must be able to use objects of derived classes without knowing it.”[9] See also design by contract.[9]
    • aka polymorphism
  • interface segregation
    • The interface segregation principle (ISP) states that “clients should not be forced to depend upon interfaces that they do not use.”[10][4]
  • dependency inversion
    • The dependency inversion principle (DIP) states to depend upon abstractions, [not] concretes