[squeak-dev] My view on Traits

Damien Cassou damien.cassou at gmail.com
Fri May 16 10:12:02 UTC 2008


On Fri, May 16, 2008 at 12:00 PM, Norbert Hartl <norbert at hartl.name> wrote:
> If you like to have an example look at the collections hierarchy. That
> is a perfect example for that. These are full of "diamond problems".
> And what options do you have to solve it? Here my top approaches (worst
> first):
>
> - code duplication. Don't need to comment that
> - delegation. Adds a lot of one line methods. Code is growing and is
>  error prone
> - moving implementation up the hierarchy. This leads to something like
>  ArrayedCollection>>add: newObject
>        self shouldNotImplement
> - traits. Not easy to understand and adds complexity


For a discussion about these questions and the Stream hierarchy, have
a look at «Traits at Work: the design of a new trait-based stream
library» http://www.iam.unibe.ch/~scg/Archive/Papers/Cass08a-NileNewKernel-ComputerLanguages.pdf.
Here, we identify all problems with the current Stream hierarchy,
design a new one based on traits and discuss the differences and
drawbacks.


-- 
Damien Cassou
Peter von der Ahé: «I'm beginning to see why Gilad wished us good
luck». (http://blogs.sun.com/ahe/entry/override_snafu)



More information about the Squeak-dev mailing list