Skip to content

Instantly share code, notes, and snippets.

@phosphene
Last active December 12, 2015 05:08
Show Gist options
  • Save phosphene/4719380 to your computer and use it in GitHub Desktop.
Save phosphene/4719380 to your computer and use it in GitHub Desktop.
Law of Parsimony in Practical Object-Oriented Design
Occam's Razor or Lex Parsimoniae or the Law of Parsimony
"It is vain to do with more what can be done with fewer"
It is an heuristic for design; it is not a golden hammer.
applying the razor to SOLID:
We get: Cohesive responsibility, cohesion, object coherence, or single responsibility.
Design in the simplest sense here is domain modeling through classes that are:
cohesive units that are as independent as possible or SRP without entanglement.
applying the razor to OOD: favor composition over inheritance.
Practical Object-Oriented Design is focused on behavior, on messages, not on Data.
In Rails that means: You should be focused on modeling behavior and not on the Data Model
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment