Newsgroups: comp.lang.smalltalk
Path: cantaloupe.srv.cs.cmu.edu!das-news2.harvard.edu!fas-news.harvard.edu!newspump.wustl.edu!news.ecn.bgu.edu!vixen.cso.uiuc.edu!howland.reston.ans.net!torn!nott!cunews!tina.mrco.carleton.ca!knight
From: knight@mrco.carleton.ca (Alan Knight)
Subject: Re: What is the ST equivalent to this C++ idiom (#1)?
X-Nntp-Posting-Host: tina.mrco.carleton.ca
Message-ID: <knight.811731832@tina.mrco.carleton.ca>
Sender: news@cunews.carleton.ca (News Administrator)
Reply-To: knight@mrco.carleton.ca (Alan Knight)
Organization: The Object People
References: <43p0tl$22ki@news.gate.net>
Date: Fri, 22 Sep 1995 01:03:52 GMT
Lines: 29

In <43p0tl$22ki@news.gate.net> nedkonz@gate.net (Ned Konz) writes:


>The first is the use of multiple inheritance to provide mix-in
>interfaces. (This is my way to provide something similar to the kind
>of interface inheritance in, say, Java.) Most of these mix-ins have
>little or no state  of their own (they may well be abstract
>interfaces). An example is the modeling of the relationship between an
>object and its sole client, where the interaction requires, say,
>exclusive use and some handshaking:
...
>How does an idiomatic Smalltalk programmer do this? Of course,
>Smalltalk has no multiple inheritance, so you can't do this directly.
...
>There must be some clean, readable way to do this in Smalltalk without
>moving B from its proper place as a class derived from C. What is it?


There is. Just do it. Inheritance is irrelevant to polymorphism in
Smalltalk, and there are no explicit interfaces. If you want to use
two objects interchangeably, do it. They don't have to inherit from
the same place.


-- 
 Alan Knight                | The Object People
 knight@acm.org             | Smalltalk and OO Training and Consulting
 alan_knight@mindlink.bc.ca | 509-885 Meadowlands Dr.
 +1 613 225 8812            | Ottawa, Canada, K2C 3N2
