7. Inheritance or…?
• Does ObjectB want to expose the complete interface (all public
methods no less) of ObjectA such that ObjectB can be used where
ObjectA is expected?
8. Inheritance
• A Cessna biplane will expose
the complete interface of an
airplane, if not more.
• Cessna biplane is a Airplane
11. Composition
• A Bird may need only the fly
behavior of an Airplane.
• Airplane has fly, takeOff, lift,
thrust, land
• Bird has fly, takeOff, lift, thrust,
land