[Seaside] Using Dynamic Bindings in Seaside rendering

Cees de Groot cg at cdegroot.com
Mon May 12 00:48:02 CEST 2003


[a *very* late response, because I only just am catching up with the
Seaside list]

On Fri, 2003-04-18 at 21:42, Derek Brans wrote:
> Using Dynamic Bindings you can tell all subcomponents of a component to use
> that component for different things (like #myMainComponent or #myForm)
> 
I'm not sure - and sorry for me being so lazy not to look it up - how
dynamic bindings work, but VW has something called ProcessEnvironment,
which is a dictionary in a Process instance var (with inheritance
through parent processes). That's not exactly a dynamic binding but is
trivial to implement and works fine.

VW's WebToolkit uses #doSomething:request:response and puts the session
in the request. As I want to separate my 'application-level' sessions
from these 'UI-level' sessions, I stash my own Session class instances
in the WebToolkit Sessions, grab the one from the request session ASAP
and stash it in the current process environment. Works like a charm, and
I like it a lot (simple, and clear - dynamic bindings always have this
'who knows what might be on the stack' trickiness with all shorts of
potential shadowing problems, I thing adding a dict to Process is just
as fine for most cases and certainly good enough for this case). 

In fact, the only thing I do with VW's Session is really UI-level stuff
(I store model bindings etcetera in there - that's all stuff where the
request is necessary anyway to read form variables etcetera), all the
interesting bits (current user, language settings, color scheme, who's
website he's logged into, ...) are in my own Session class that's made
available to the current process.

Anyway, I'm pleading from ignorance here, as it has been a while since I
looked at the Dynamic Bindings stuff, but I find the whole concept a bit
icky so I'd vote for something simpler if possible..


-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
Url : http://lnx-12.ams-2.theinternetone.net/pipermail/seaside/attachments/20030511/bb611d74/attachment.bin


More information about the Seaside mailing list