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.)

 

ɕ

I write here most days — reflections, quotes, and working with the garage door up. This is one of more than 5,000 posts. Wander to another →

If you like the way I think, you might like what I’m reading. Every so often I send out 7 for Sunday — seven things I’ve savored, about five minutes, whenever they’re ready. No hooks, no nonsense. Read a recent issue →