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

Max Leske maxleske at gmail.com
Mon May 29 15:51:12 UTC 2017


> On 29 May 2017, at 17:24, 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.
> 
> 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?

In general, I agree. I’m not sure what the performance costs might be, however. It’s only one message send but they add up to a lot (context creation isn’t free, unfortunately). Could you try and run a benchmark?

Max

> 
> 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.
> _______________________________________________
> 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