comp.lang.ada
 help / color / mirror / Atom feed
From: milt@lax.pe-nelson.com (Milt Ratcliff)
Subject: Re: Difference between inheritance and package use
Date: 23 Jun 91 22:02:35 GMT	[thread overview]
Message-ID: <320@mem.lax.pe-nelson.com> (raw)
In-Reply-To: 1991Jun23.185111.24706@netcom.COM


>]>   A tractor does not share much interface with a wheel or an engine.
>]>Describing a tractor as inheriting from Wheel and Engine, would be
>]>stupid.

>Agreed, stupid it would be. It would also, by the way, be
>a great example of multiple inheritance. ;-)

Perhaps, but it would be a very BAD example of multiple inheritance since
a tractor is NEITHER a wheel nor an engine.  A tractor which uses a wheel
or engine would actually be a form of composition.

If the tractor inherits from some 'vehicle' object of which it is a true
specialization the inheritance would be more correct.

I have rarely seen inheritance used without the posibility of also using
composition to provide part of the specialization.

Milt
-- 
Milt Ratcliff                                            milt@pe-nelson.com
PE-Nelson                                                +1.408.725.1107
10040 Bubb Road
Cupertino, CA  95014
-- 
Milt Ratcliff                                            milt@pe-nelson.com
PE-Nelson                                                +1.408.725.1107
10040 Bubb Road
Cupertino, CA  95014

  reply	other threads:[~1991-06-23 22:02 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1991-06-21 22:46 Difference between inheritance and package use Mike Miller
1991-06-22  1:31 ` Jim Showalter
1991-06-23 13:59   ` Alan Knight
1991-06-23 18:51     ` Jim Showalter
1991-06-23 22:02       ` Milt Ratcliff [this message]
1991-06-23 20:16     ` Philip Machanick
1991-06-24 19:33 ` Douglas S. Gray
1991-06-24 20:39   ` Rob Spray
1991-06-25 16:04     ` Douglas S. Gray
1991-06-25 19:52   ` Jim Showalter
  -- strict thread matches above, loose matches on Subject: below --
1991-06-22  3:53 Chuck Shotton
1991-06-23  3:06 ` Jim Showalter
1991-06-23  8:38   ` Orville R. Weyrich
1991-06-24  3:32   ` Marco S Hyman
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox