Thread Links Date Links
Thread Prev Thread Next Thread Index Date Prev Date Next Date Index

RE: viewpoints and multiple inheritance.




At 10:46 -0400 8-06-2000, Mann, Douglas D wrote:
>Here is an interesting example of multiple inheritance based upon the state
>at an instance.
>
>In the US a seaplane is a:
>1. airplane when flying that requires lighting for aircraft
>2. uncontrolled boat when landing that require lighting for an uncontrolled
>boat
>3. controlled boat when taxiing that requires lighting for a controlled boat
>
>

This is *NOT* a case of multiple inheritance.  Of course what we mean 
by inheritance (a truly unfortunate term) is a process that is 
usually associated with a subsumption relation, sometimes called is-a 
or subclass, in which properties of the subsuming class become 
properties of the subsumed class.

Multiple inheritance therefore really means a class/property/concept 
(I'm being a bit sloppy here) that is subsumed by more than one 
c/p/c...

When one property is subsumed by another, say Q subsumes P, it means only this:

FORALL x P(x) -> Q(x)

Inheritance just "happens" in a logical framework as a result of 
carrying through the natural consequences of this implication.

A seaplane is NOT NOT NOT a subclass of AIRPLANE, UNCONTROLLED-BOAT 
and CONTROLLED-BOAT!!!  This is just wrong.  This is, in fact, 
precisely Nicola's point.  Multiple inheritance is TOO OFTEN used to 
"bundle together" properties that a class of objects may "sometimes" 
exhibit.  It is because of this almost universal lack of discipline 
that we should consider not having multiple inheritance.

-Chris W.

Christopher A. Welty                          Professore Visitatore
LADSEB-CNR                                   welty@ladseb.pd.cnr.it
Corso Stati Uniti, 4                         Voice: +39 049 8295783
I-35127 Padova                                 Fax: +39 049 8295763
Italy                       http://www.cs.vassar.edu/faculty/welty/