[Seaside-dev] DOM element ID registry at the component

Esteban A. Maringolo emaringolo at gmail.com
Fri Sep 22 16:14:58 UTC 2017


Hi all,

Coming back to this, yesterday Mariano Martinez Peck refreshed my
memory about Magritte way of dealing with this in a deterministic,
with a an acceptable collision resistance, way of generating the IDs:

MAComponent>>ajaxId: aSymbol
  ^String streamContents: [ :stream |
     stream
       nextPutAll: 'ajax';
       nextPutAll: self class name;
       print: self hash;
       nextPutAll: aSymbol ]

I don't like that it leaks the class name, but modifying the class
name with a portion of the class name hash resolves that.

So this way there is no need to keep a reference to the ID, since the
ID can be regenerated in a deterministic manner.

Regards!

Esteban A. Maringolo


2017-09-11 13:56 GMT-03:00 Esteban A. Maringolo <emaringolo at gmail.com>:
> 2017-09-11 12:47 GMT-03:00 Philippe Marschall <philippe.marschall at gmail.com>:
>> Hi
>>
>> I don't think I would put that on WAComponent, WAComponent is really
>> generic and (in theory) doesn't even have a dependency on
>> WAHtmlCanvas. Also we probably don't want to backtrack it, for example
>> WACounter implements #states like this:
>>
>> states
>>   ^ Array with: self
>
> I didn't think about backtracking,
>
> Actually the #states method is something I keep forgetting about, and
> hence seldom use.
>
>> But it could definitively find a place somewhere else.
>
> Like in my own abstract component superclass :)
>
> Thanks!
>
>
> Esteban A. Maringolo


More information about the seaside-dev mailing list