Introduction to OOP: Chapter 7: Inheritance [next] [previous] [audio] [real] [text]

Heuristics for Subclassing - Variance

Two or more classes that seem to be related, but its not clear who should be the parent and who should be the child.

Example: Mouse and TouchPad and JoyStick

Better solution, abstract out common parts to new parent class, and use subclassing for specialization.

Intro OOP, Chapter 7, Slide 14