SOLID object-oriented design

Five basic principles of object-oriented design. Not the only five, but five which are, well, SOLID.

Single responsibility – A class should have only a single responsibility.

Open/closed – Open for extension; Closed to modification.

Liskov substitution – Objects can be replaced by instances of their sub-types without breakage or surprise.

Interface segregation – Many, specific interfaces – that is, APIs – are better than fewer, more general-purpose interfaces. (…or “interface” in the worst case.)

Dependency inversion – Depend upon the abstraction. (Not upon the specific concretion.)

 

ɕ