[squeak-dev] Re: Some questions about new traits (Crismas edition) ; )

Igor Stasenko siguctua at gmail.com
Mon Dec 28 05:22:00 UTC 2009


Btw, regarding class-side traits.

Me think, that traits should only be applicable to Behavior,
meaning that trait carrying a pack of methods which can be applied to
any Behavior instance, holding a concrete
method dictionary, but nothing else.

Personally, i don't see much sense in having traits which defining
some behavior on both sides.
They could be always split on two (and actually, current
implementation keeps inst/class sides in separate traits).

The choice, where trait should be applied, can be made in class definition:

Object subclass: #MyClass
	uses: MyTrait
	instanceVariableNames: ''
	classVariableNames: ''
	poolDictionaries: ''
	category: 'mycat'

or for class side:

MyClass class
	uses: MyTrait
	instanceVariableNames: ''

This could simplify traits implementation.

-- 
Best regards,
Igor Stasenko AKA sig.



More information about the Squeak-dev mailing list