[squeak-dev] On traits composition

Igor Stasenko siguctua at gmail.com
Tue Dec 8 17:34:41 UTC 2009


2009/12/8 Colin Putney <cputney at wiresong.ca>:
>
> On 7-Dec-09, at 9:01 PM, Andreas Raab wrote:
>
>> Oh, and one more issue: I'm starting to question the idea that
>> "conflicting" trait methods should create a trait conflict. It seems to me
>> that "last one wins" would be more useful, i.e., if you have two traits t1
>> and t2 and use them via t1+t2 you get t2's version; if you use them via
>> t2+t1 you get t1's version. You're always free to override the version if
>> you don't like the result but I think that "last one wins" will be a useful
>> outcome in more cases than raising an error :-)
>
> That wouldn't be Traits, it would be Mixins. Maybe you'd rather have Mixins?
> It would be interesting to compare Strongtalk's collection classes to the
> paper about refactoring Collections to use Traits.
>

Why?
Can composition be an ordered collection of traits, so, they applied
in sequencial order to class?
Mixins use an inheritance chaining to achieve same effect.
But traits don't using inheritance, and that's, i think, the main
difference between them and mixins, but not the order of composition.

> Colin
>
>



-- 
Best regards,
Igor Stasenko AKA sig.



More information about the Squeak-dev mailing list