[Seaside-dev] Configurable current request context variable

Philippe Marschall philippe.marschall at gmail.com
Sun May 7 21:09:02 UTC 2017


On Sun, May 7, 2017 at 8:26 AM, Max Leske <maxleske at gmail.com> wrote:
>
>> 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.

I see the need but have reservations about the implementation. We have
other dynamic variables which would benefit from this as well.
WADynamicVariable is supposed to be our portable dynamic variable
abstraction.
Do you know what the situation is in the other dialects (GS, VASt, VW)
regarding dynamic variables? Do they have a DynamicVariable class as
well?
In theory we could say that the dialect has to provide a
GRDynamicVariable, we could provide a GRExceptionBasedDynamicVariable.
Dialects that have a DynamicVariable class could provide
GRDynamicVariable as a subclass of DynamicVariable. Dialects that do
not have a DynamicVariable class could provide GRDynamicVariable as a
subclass of GRExceptionBasedDynamicVariable.

Cheers
Philippe


More information about the seaside-dev mailing list