Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!samsung!usc!zaphod.mps.ohio-state.edu!ncar!gatech!bloom-beacon!eru!hagbard!sunic!mcsun!cernvax!chx400!bernina!neptune!inf.ethz.ch!brandis From: brandis@inf.ethz.ch (Marc Brandis) Newsgroups: comp.object Subject: Re: Examples of Multiple Inheritance? Summary: Programming languages are not the real world ! Keywords: multiple inheritance Message-ID: <17562@neptune.inf.ethz.ch> Date: 6 Dec 90 10:34:55 GMT References: <60700005@inmet> <980@culhua.prg.ox.ac.uk> Sender: news@neptune.inf.ethz.ch Reply-To: brandis@inf.ethz.ch (Marc Brandis) Organization: Departement Informatik, ETH, Zurich Lines: 35 In article <980@culhua.prg.ox.ac.uk> ajs@prg.ox.ac.uk (Adolfo Socorro) writes: >There are lots. How about > > Person > / \ > Student Teacher > \ / > Teaching Assistant > >or perhaps > > Account > / \ > Savings Checking > Account Account > \ / > NOW Account > Sorry, but I think you are missing the point. The fact that there are examples in the real world where a thing has properties of several other things does not imply that you need multiple inheritance in a programming language. Very often, the kind of situations that you are describing can be solved by using references to other objects and just deriving from one class. You may argue that this is not a direct projection of the real world into the program, but this is not needed at all. What would be interesting are some examples where multiple inheritance was useful in writing a large program, which would have been much harder to implement without it. Marc-Michael Brandis Computer Systems Laboratory, Swiss Federal Institute of Technology CH-8092 Zurich, Switzerland email: brandis@inf.ethz.ch Brought to you by Super Global Mega Corp .com