[Seaside] session reference

Avi Bryant seaside@lists.squeakfoundation.org
Fri, 6 Dec 2002 18:33:49 -0800 (PST)


On Fri, 6 Dec 2002, Stephen Pair wrote:

> Avi,
>
> How are you managing that (sorry, just wanted to drop a quick note...no
> time to look at the code at the moment)?  I assume that you must be
> keying something off of the activeProcess.

No, actually, I just abuse exception handling.  Any request handled by
that session is wrapped in a handler that will respond to a
WACurrentSessionNotification by resuming and passing in the session.

> This is one of those issues that I struggled with for quite some time
> (and went through about 3 or 4 iterations)...what I finally came up with
> was the "Runtime Environments" solution (which I just published on
> SqueakMap).  With Runtime Environments, I think I have a good, clean and
> general solution to this class of problems.  If you get a chance, I'd
> appreciate feedback.

Yeah, I just looked at Runtime Environments.  They would certainly do the
trick, but it's an extra dependency and using exceptions works fine (it
doesn't handle forking as cleanly, but then it doesn't make sense to fork
the UI in Seaside - or not in the traditional sense ;-).

One thing that interested me about Runtime Environments was that it is
extremely close to the StateFrame that Seaside uses to manage
backtrackable object state (does Kats use RE in the same way?).  The main
difference, I think, is that once you create a child StateFrame the parent
becomes immutable, and its associations get copied down into the child to
avoid long lookup chains.  I then create a new child state every time a
continuation is resumed.  If you can think of a way of unifying those two,
I'd like to hear it.  The Runtime Environment is quite likely something
that would want to backtrack in sync with continuations, after all.