Comparison
Is-avsHas-a
Is-a
It is rough because the English sentence is easy to talk yourself into.
Has-a
The real test is whether every operation the parent promises still makes sense.
The difference
The rough test for whether a relationship should be inheritance or a field: inheritance claims the subtype is usable everywhere the supertype is, while composition only claims it uses one. It is rough because the English sentence is easy to talk yourself into; the real test is whether every operation the parent promises still makes sense. Most classic inheritance mistakes pass the sentence and fail the operation.
Entry: Is-a vs has-a →