[Seaside-dev] WATagBrush>>#tag should be class side?

Esteban A. Maringolo emaringolo at gmail.com
Tue May 30 12:21:17 UTC 2017


Hi Phil, all,

2017-05-30 3:19 GMT-03:00 Philippe Marschall <philippe.marschall at gmail.com>:

>> [1] The only case I found is the heading tag, that uses h1, h2, h3,
>> etc.;and it would continue to work.
>
> There are more that won't work like WAGenericTag.

WAGenericTag class>>tag currently returns nil, which currently doesn't
work as well, so in this particular case the behavior would be
preserved.

> As said before there are several cases that don't work and tooling
> needs work arounds for those anyway. So there seems to be no again.
> To me the biggest argument against is that it's behaviour of the
> instance and not the class and should therefore be on the instance
> side.

I'd argue the opposite, since most returned values (tag strings) are
the same for all the instances of the same class; with the already
mentioned exception of heading and generic tag. I tend to define such
behaviors class side, but it is a matter of coding style [*].

In the case of WAHeadingTag class>>#tag it returns 'h1', which is a
reasonable default, and I already mentioned the case of WAGenericTag.

I'm fine with whatever you choose, I'm not a core developer of
Seaside, but my question was raised in the context of tooling, when I
was trying to map tags to brush classes and canvas selectors (e.g. 'a'
-> WAAnchorTag or #anchor).

As you said I'll use the #basicNew workaround to avoid any
initialization, it seems to work so far.

Thank you for you input!

--
Esteban A. Maringolo

[*] I particularly find "wrong" (taste/stylewise) the need to
instantiate an object, which in many cases is not properly
initialized, to obtain a value that is not computed using anything
related with the instance, I feel the same with Magritte 3 that
requires you to instantiate an object just to get a MADescription. I
like to be able to query the class for "general" behavior, and then
implement everything instance side overriding when appropriate and
delegating to the class side by default.


More information about the seaside-dev mailing list