Newsgroups: comp.object,comp.lang.smalltalk,comp.lang.ada
Path: cantaloupe.srv.cs.cmu.edu!das-news2.harvard.edu!news4.ner.bbnplanet.net!news3.near.net!paperboy.wellfleet.com!news-feed-1.peachnet.edu!gatech!howland.reston.ans.net!news.sprintlink.net!news.wwa.com!rcm!rmartin
From: rmartin@rcmcon.com (Robert Martin)
Subject: Re: Has C++ had its day?
References: <NEWTNews.803919664.16092.sellers@sellers.sellers.com> <dewar.804000976@gnat> <Jan.Bytesmiths-2606951420580001@138.120.62.112> <1995Jun27.121935.4921@merlin.hgc.edu> <Jan.Bytesmiths-2806951021280001@138.120.62.112>
Organization: R. C. M. Consulting Inc. 708-918-1004
Date: Thu, 29 Jun 1995 15:58:35 GMT
Message-ID: <1995Jun29.155835.5444@rcmcon.com>
Lines: 42
Xref: glinda.oz.cs.cmu.edu comp.object:33906 comp.lang.smalltalk:25189 comp.lang.ada:31881

Jan.Bytesmiths@acm.org writes:

>Multiple inheritance is simply yet another mechanism for adding behavior
>to an object. There was a famous paper in OOPSLA 86: "Delegation is
>Inheritance," that showed the two are equivalent. 

I can see the equivalence in a dynamically typed language, but I think
That the equivalence breaks down in a statically typed language.  The
reason is that the delegator is not a subtype of the delegatee.   Now
one could fudge this by creating abstract base classes that both
inherit from, but then you have inheritance again.

>Smalltalkers lean
>heavily on delegation wherever a C++er would think of MI. 

For exactly the reason above. 

>In particular,
>general delegation (implementing #doesNotUnderstand:) simulates MI well
>enough to pass a black-box test, albeit less efficiently.

But not in statically typed languages.

>Having worked with both, I find delegation more controlled and easier to
>debug. Delegation is a partnership, where one object agrees to share its
>responsibilities with some other object in a manner it controls. MI is
>schizophrenia, where the poor object has no idea what its personality is
>going be from one compile to the next!

This is silly.  MI, in statically typed language, is simply the union
of two interfaces.  Assigning psychopathies to software is an
inappropriate anthropomorphism.  Objects aren't people, they cannot be
psycopathic.  They are just bits of software doing a job.  And if
their job is to mediate between two or more interfaces, well that is
nothing new or strange.


-- 
Robert Martin       | Design Consulting   | Training courses offered:
Object Mentor Assoc.| rmartin@oma.com     |   OOA/D, C++, Advanced OO
2080 Cranbrook Rd.  | Tel: (708) 918-1004 |   Mgt. Overview of OOT
Green Oaks IL 60048 | Fax: (708) 918-1023 | Development Contracts.
