title: Inheritance or composition: Rely on "is-a" and "has-a"?
body: <p>When I design classes and have to choose between inheritance and composition, I usually use the rule of thumb: if the relationship is "is-a" - use inheritance, and if the relationship is "has-a" - use composition.</p>
  
  <p>Is it always right? </p>
  
  <p>Thank you.</p>