Newsgroups: comp.object,comp.lang.smalltalk,comp.lang.ada
Path: cantaloupe.srv.cs.cmu.edu!europa.chnt.gtegsc.com!news.sprintlink.net!mv!usenet
From: rapp@lmr.mv.com (L. M. Rappaport)
Subject: Re: Multiple Inheritance (was Re: Has C++ had its day?
Message-ID: <DBAowH.48p@mv.mv.com>
Nntp-Posting-Host: lmr.mv.com
Sender: usenet@mv.mv.com (System Administrator)
Organization: MV Communications, Inc.
Date: Thu, 6 Jul 1995 15:49:47 GMT
References: <NEWTNews.803919664.16092.sellers@sellers.sellers.com> <dewar.804000976@gnat> <Jan.Bytesmiths-2606951420580001@138.120.62.112>  <1995Jun27.121935.4921@merlin.hgc.edu> <NEWTNews.804269222.4596.sellers@sellers.sellers.com> <1995Jun29.153521.5115@rcmcon.com> <dewar.804467263@gnat> <3te7t8$lsm@watnews2.watson.ibm.com>
X-Newsreader: Forte Free Agent 1.0.81
Lines: 35
Xref: glinda.oz.cs.cmu.edu comp.object:34485 comp.lang.smalltalk:25532 comp.lang.ada:32176

jjb@watson.ibm.com (John Barton) wrote:

>In article <dewar.804467263@gnat>, dewar@cs.nyu.edu (Robert Dewar) writes:
>|> One of the reasons that Ada did not follow C++ and provide some kind
>|> of specific built-in multiple inheritance was that, despite a lot of
>|> effort, we failed to find any convincing examples that suggest that
>|> this is a good idea.
>|> 

>  How can one specify that an object satisfies two or more interfaces
>in C++ without multiple inheritance?  For example,
>consider an instrument control system.  A voltage supply in this 
>system might be usable as a VoltageSupply and, simulataneously, as
>an GPIBInstrument (GPIB is a controller bus).   An effective way to
>model this in C++ is to derived a specific supply representation from
>both existing abstract classes VoltageSupply and GPIBInstrument.  The
>only other way I know to do this is with pointer-proxy classes, a lot
>more work.

I would approach it by deciding which I am trying to model and
supplying the other behavior via delegation.  In C++, I think you
would use mixins.   I think the context of your language often drives
the design, although I'm not at all sure that that is necessarily
best.

Larry
--



--------------------------------------------------------------
L. M. Rappaport & Associates, Inc.       Voice +1.603.237.8400
P. O. Box 158                            Fax   +1.603.237.8430
Colebrook, NH 03576                      CIS   72427,2567

