Morphic is to MVC as Traits are to Classes (was: Re: RemovingMorphic)

J J azreal1977 at hotmail.com
Fri Oct 20 19:42:11 UTC 2006


>From: Andreas Raab <andreas.raab at gmx.de>
>Reply-To: The general-purpose Squeak developers 
>list<squeak-dev at lists.squeakfoundation.org>
>To: The general-purpose Squeak developers 
>list<squeak-dev at lists.squeakfoundation.org>
>Subject: Morphic is to MVC as Traits are to Classes (was: Re: 
>RemovingMorphic)
>Date: Wed, 18 Oct 2006 19:28:52 -0700
>
>Keith Hodges wrote:
>For example, I can send the message #bounds to the costume and get the 
>composite bounds for the entire costume or I can send the message #bounds 
>to the text aspect and get only the text bounds. It is always clear what I 
>mean since I have to specify either "costume bounds" or "costume text 
>bounds" and it never changes, neither in the aspect nor the costume. 
>Compare this to a traits solution where I'd have to rename one of the two. 
>Which one is clearer? The one where I say "bounds" when I implement a trait 
>and "textBounds" when I use it? Where "show me the senders of #textBounds" 
>finds the senders in the composition but not in the trait? Or where 
>"senders of bounds" also lists all the senders of #textBounds since they 
>were once called #bounds? I think the answer is clear.
>

I thought traits were only for the specific situation where single 
inheritance wont work.  The paper I read described them as being a better 
solution then multiple inheritance, java interfaces, etc..  So I guess what 
I am missing in this example is: what was the driving force that would make 
you need traits here, and how did you end up solving it?

_________________________________________________________________
Use your PC to make calls at very low rates 
https://voiceoam.pcs.v2s.live.com/partnerredirect.aspx




More information about the Squeak-dev mailing list