[Seaside-dev] Configurable current request context variable

Max Leske maxleske at gmail.com
Sun May 7 06:26:00 UTC 2017


> On 6 May 2017, at 20:04, Philippe Marschall <philippe.marschall at gmail.com> wrote:
> 
> On Sat, May 6, 2017 at 5:34 PM, Max Leske <maxleske at gmail.com> wrote:
>> Hi,
>> 
>> I would like to use a current request context variable that inherits from DynamicVariable in Pharo and not from WADynamicVariable (I don't want to use the exception mechanism).
> 
> Can you provide a bit more context? How is it implemented in Pharo? To
> with Pharo versions does this apply?

Sure. DynamicVariables are stored in the environment of the process. They are singletons and the sole instance is used as the lookup key into the process environment dictionary. The access semantics are nearly identical to WADynamicVariable, so they can easily be exchanged. There are two advantages over WADynamicVariable:

1. Access time is constant and no handler context is required
2. The process environment can easily be copied, making it possible to transfer availability of a request context to a different process, e.g. for debugging (I've done that for our own apps in Seaside 2.8)

DynamicVariable has been in Pharo at least since version 1.1.1. and I have been using it in production as a replacement for WACurrentSession from Seaside 2.8 for about two years now.

Cheers,
Max

> 
> Cheers
> Philippe
> _______________________________________________
> seaside-dev mailing list
> seaside-dev at lists.squeakfoundation.org
> http://lists.squeakfoundation.org/mailman/listinfo/seaside-dev



More information about the seaside-dev mailing list