<p>Why prefer composition over inheritance?  What trade-offs are there for each approach?  When should you choose inheritance over composition?</p>

Think of containment as a
has a
relationship. A car "has an" engine, a person "has a" name, etc.
Think of inheritance as an
is a
relationship. A car "is a" vehicle, a person "is a" mammal, etc.
I take no credit for this approach. I took it straight from the
Second Edition of Code Complete
by
Steve McConnell
,
Section 6.3
.