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

Tobias Pape Das.Linux at gmx.de
Tue May 30 07:35:36 UTC 2017


> On 30.05.2017, at 08:19, Philippe Marschall <philippe.marschall at gmail.com> wrote:
> 
> On Mon, May 29, 2017 at 5:24 PM, Esteban A. Maringolo
> <emaringolo at gmail.com> wrote:
>> I'm playing with a small utility that walks the canvas and the
>> hierarchy of WATagBrush, and one thing I find is that #tag method is
>> implemented on the instance side, whilst the class side requires a new
>> instance to obtain the HTML tag name.
>> 
>> In most cases this isn't an issue since brushes are simple, but in the
>> case of WABasicFormTag it tries to get the encoding from the request
>> context and you fail to obtain the tag unless within a context.
> 
> you can try #basicNew which doesn't send #initialize or check if the
> source is a simple return of a string literal.
> 
>> Since the returned value doesn't change based on conditions of the
>> brush [1], shouldn't #tag be implemented class side and instances
>> delegate to the class by default and implement only if necessary?
>> 
>> As far as I could see the change would be idempotent, even third party
>> subclasses of WATagBrush would continue to work if they don't
>> implement #tag class-side.
>> 
>> What do you think?
>> 
>> Esteban A. Maringolo
>> 
>> [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.
> 
> 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.

+1

> 
> Cheers
> Philippe
> _______________________________________________
> seaside-dev mailing list
> seaside-dev at lists.squeakfoundation.org
> http://lists.squeakfoundation.org/mailman/listinfo/seaside-dev



More information about the seaside-dev mailing list