This is a blog about strategies and tactics I have learned, mostly from my experience of playing 3D fighting games and reading classic strategy books. Oh... and Java.

Wednesday, March 4, 2009

The SOLID principles in order of importance according to Uncle Bob

Uncle Bob had a podcast on Hanselminutes where he discusses the SOLID principles at length. I highly recommend you listen to the whole thing if you want to learn what the SOLID principles are. I'll wait..........

Ok, now that you know what SOLID's all about, I want to point out that off the top of his head, Uncle Bob listed the principles in order of importance:
  1. Single Responsibility Principle
  2. Dependency Inversion Principle
  3. Open Closed Principle
  4. Liskov Substitution Principle
  5. Interface Segregation Principle

I'd like to learn exactly why these principles are ordered this way, but, the podcast didn't really focus on this perspective.


unclebobmartin said...

SRP because it's probabaly at the root of everything. All the principles may eventually boil down to SRP. (or DRY).

DIP because it's the primary mechanism for achieving all the others. SRP, OCP, LSP, ISP all make use of DIP in one way or another.

OCP because it's the proximate goal. It describes the traits we want our software to have at nearly every level.

LSP because its influence is stronly associated with certain langauges. The dependency problems caused by LSP in C++ don't occurr in Ruby for example. Other problems do though.

ISP because it is almost entirely related to static languages. The dependency problems related to fat classes so common in Java and C#, are non-existent in lanuages like python and ruby.

Mark Nijhof said...

Cool, I thought I was the only one that thinks SDOLI was the better order. Especially for explaining purposes.

Cool summary Bob.


tieTYT said...

Thanks a lot Uncle Bob. I really appreciate the time you took to answer that.