Class Design Principles

About Class Design Principles

Class Design Principles …

  • state desired properties of class designs.

  • are heuristics.

  • help making a class design usable for client classes.

Class Design Principles ...

Class Design Principles aim for code we can efficiently work on!

The S.O.L.I.D. Principles:

  • Single Responsibility Principle (SRP)
  • Open-closed Principle (OCP)
  • Liskov Substitution Principle (LSP)
  • Interface Segregation Principle (ISP)
  • Dependency Inversion Principle (DIP)

During its lifetime of a software the (class) design changes constantly. This is a consequence of requirement changes which is the rationale for conducting an iterative design process.

Class Design Principles are not only about the current state of the code, but also give you an understanding of how well the code will be under the effect of change. Especially whether and how changes will affect client classes.