Object: Identity vs. Environment

Joel Shellman joel at ikestrel.com
Mon Jun 9 07:52:38 UTC 2003


Ah, I think what you're referring to is double dispatch, isn't it?

http://c2.com/cgi/wiki?DoubleDispatch

Which so far as I understand it makes good sense.

-joel

----- Original Message ----- 
From: "Andres Valloud" <sqrmax at comcast.net>
To: "The general-purpose Squeak developers list"
<squeak-dev at lists.squeakfoundation.org>
Sent: Monday, June 09, 2003 12:04 AM
Subject: Re: Object: Identity vs. Environment


> > But you might have a dozen methods with isFoo + ifTrue/ifFalse.
> > Then you would need Object>>fooAction1, Object>>fooAction2, etc.
>
> The dozen actions will get written one way or the other, either inside
> ifTrue/ifFalse blocks or in messages.  As far as the amount of code is
> concerned, fooActions are at least as compact - if not more since you
> don't need ifTrue/ifFalse.
>
> The key issue here is that the ifTrue/ifFalse actions should be in
> messages the receivers of isXYZ understand.  Otherwise, the context in
> which you write the ifTrue/ifFalse actions has to grow larger to provide
> meaning to the actions.  You end up as if you had used a traditional
> programming language: the receivers of isXYZ are more value holders than
> behaviorful distinctions as far as the context of usage is concerned.
>
> Disclaimer: these arguments apply only to the "isKindOf:" kind of isXYZ
> messages.
>
> Andres.
>



More information about the Squeak-dev mailing list