[Seaside-dev] Two minor implementation questions

Bany, Michel mbany at cincom.com
Tue Oct 16 13:23:34 UTC 2007


> > WADispatcher>>beAwareOfChangeOf: anAspectSymbol with: aParameter
> > from: anEntryPoint
> >         (anEntryPoint == self
> >                 and: [anAspectSymbol == #name]) ifTrue: [^ self].
> >         "Here when anything has changed but the name in the
> >         receiver"
> >         version := self version + 1.
> >         lastUpdate := TimeStamp now.
> >         self changed
> >
> > At issue is the last line of code "self changed". The "changed"
> > method appears to call Object>>changed, which eventually calls:
> >
> > Object>>changed: anAspectSymbol with: aParameter
> >
> >         self myDependents update: anAspectSymbol with: aParameter 
> > from: self
> >
> > However as far as I can see WADispacher objects return nil on "self 
> > myDependents". (I think it is a good idea to avoid using 
> dependents on 
> > Object.) So the "self changed" appears to unneeded.
> 
> This was added because VisualWorks needed it. I don't 
> remember exactly why and if it is still the case? It 
> potentially introduces portability problems, as the 
> change-notifications are implemented slightly different in 
> all Smalltalk dialects. Moreover passing symbols around is 
> not really the thing I enjoy ;-)

The WADispatcher instances form a tree where WADispatcher default is the
root. As far as I understand it, there is just one such tree in Squeak.

In my VW port, you may have many of those trees, each being a copy of
the default tree. The code that seems useless is the code that helps
propagating changes from any tree to all other trees. This uses the
regular change/update mechanism. The fact that "self myDependents"
answers nil indicates a situation where there is only one tree of
dispatchers. In more complex situations where there are multiple trees,
the "self changed" is indeed needed if you want to have all the trees in
synch. So the real question is why do we have multiple dispatcher trees
in VW?

Well, there is a strong relationship between the url and the name of the
root dispatcher, because the dispatcher name is used to match the url,
and in VW there are many urls that can reach Seaside, for instance
1. the regular url http://.../seaside/go/counter
2. the short url you get with the SeasideShortPath package
http://.../counter
3. the streaming url http://.../seaside/stream/counter
4. you get even more urls when running behind Apache
so, we need a tree of dispatchers for each of those, unless we want to
break the WADispatcher object into two pieces, one for the url lookup
and one for the dispatching....

Not a so minor implementation question, after all.

HTH
Michel.






More information about the seaside-dev mailing list