Traits in use (was Re: Re: Squeak and Namespaces)

Lukas Renggli renggli at gmail.com
Sat Dec 2 09:00:50 UTC 2006


> Lukas you mentioned to me once a cool place in seaside where traits
> would really help. But again we cannot change seaside. So bootstrap.

The canvas framework has a lot of duplicated code and/or code that is
defined too high in the hierarchy. The framework provides an
implementation of the different XHTML tags as specified in [1]. The
abstract element (WATagBrush) should only implement the relevant
methods (#attributeAt:, #attributeAt:put:, etc.) that are specified in
the W3C DOM [2] implementation.

Now XHTML has the so called generic attributes [2] (coreattrs, events,
focus, ...). It also has a notion of what can be nested into each
other. Moreover there is Seaside that defines different kinds of
callbacks, unfortunately not all kinds of callbacks are valid on all
elements. To keep it short, there is a lot of orthogonal things going
on. Tough it would be easy to put these things into traits and compose
them with the right elements. Like this you wouldn't get 11 mostly
identical implementations of #callback:, 7 identical implementations
of #on:of:, 4 identical implementations of #form:, #extnet:, #width:,
#height:, ...

Cheers,
Lukas

[1] http://www.w3.org/TR/2002/REC-xhtml1-20020801/dtds.html
[2] http://www.w3.org/TR/REC-DOM-Level-1/idl-definitions.html

-- 
Lukas Renggli
http://www.lukas-renggli.ch



More information about the Squeak-dev mailing list