[Seaside] Seaside and Dynamic variables

Cees De Groot cdegroot at gmail.com
Thu Nov 17 10:42:53 CET 2005

Kilauea, David, Kilauea ;)

But if I understand from your long post, what's wrong with my code -
it seems to do what you want, no? I am fetching the session from the
connection pool in my case, but I could just as well read an ivar from
the session in #withEscapeContinuation and set that in a dynamic
variable. Every request would then have the same value of the dynamic
variable, and non-seaside code could be wrapped in non-seaside ways of
setting up the dynamic variables on the stack. Or even use a different
method (I've taken to not using dynvars directly, probably inspired by
WACurrentSession, so I can always change my thoughts - in Kilauea,
there's XxConnectionPool currentSession for example to get to the
current db session, which works fine in Seaside now and would be
trivial to extend to other environments if necessary).

That's probably closest to your 2), I think it's the cleanest thing to
do - make a class-side accessor for the value and let that code decide
where to grab it from depending on the current environment.

I must say, being able to keep a dynamic binding context between
requests is sort of cool - thanks for puzzling that out, even though I
doubt its practical value :)



More information about the Seaside mailing list