Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!uwm.edu!gem.mps.ohio-state.edu!tut.cis.ohio-state.edu!bloom-beacon!eru!luth!sunic!mcsun!ukc!edcastle!aiai!jeff From: jeff@aiai.ed.ac.uk (Jeff Dalton) Newsgroups: comp.object Subject: Re: Inheritence and Delegation Message-ID: <1266@skye.ed.ac.uk> Date: 20 Oct 89 19:12:19 GMT References: <125984@sun.Eng.Sun.COM> <135300006@p.cs.uiuc.edu> Reply-To: jeff@aiai.UUCP (Jeff Dalton) Organization: AIAI, University of Edinburgh, Scotland Lines: 20 In article <135300006@p.cs.uiuc.edu> johnson@p.cs.uiuc.edu writes: >>Delagation reflects reality better than inheritance: your car does not >>inherit from door, tire, and engine: is is a composite made up of >>doors, tires, and an engine. The fact that the window on the left door >>is open should have no bearing on the state of other windows or the >>fuel injection or tire pressure. > >Ack! BLechttt! This is evidence of the dread disease of Flavors! >This bears NO relationship to real inheritance at all. Inheritance >is supposed to be the IS-A relationship, but a Car is not a Door. >A door is a component of a car, it is not a superclass of Car. Real inheritance? NO relationship? This is just ideology talking. Inheritance doesn't have ot be IS-A at all. If that's the attitude people are going to take, I'll choose delegation over "real inheritance" any day. BTW, Flavors doesn't say: inherit from parts; it says inherit capabilities. (IMHO). I don't like cars inheriting from doors either.