From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: * X-Spam-Status: No, score=1.1 required=5.0 tests=BAYES_40,INVALID_DATE, MSGID_SHORT autolearn=no autolearn_force=no version=3.4.4 Xref: utzoo comp.lang.ada:5796 comp.object:3786 Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!think.com!spool.mu.edu!uunet!lax!milt From: milt@lax.pe-nelson.com (Milt Ratcliff) Newsgroups: comp.lang.ada,comp.object Subject: Re: Difference between inheritance and package use Keywords: Inheritance, Object Orientation Message-ID: <320@mem.lax.pe-nelson.com> Date: 23 Jun 91 22:02:35 GMT Article-I.D.: mem.320 References: <1991Jun21.224640.24583@src.honeywell.com> <1991Jun22.013149.28268@netcom.COM> <1991Jun23.135921.19166@cunews.carleton.ca> <1991Jun23.185111.24706@netcom.COM> Followup-To: comp.lang.ada Organization: PE-Nelson, Cupertino, CA List-Id: >]> 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