[Seaside-dev] Configurable current request context variable

Max Leske maxleske at gmail.com
Mon May 8 06:57:16 UTC 2017


> On 7 May 2017, at 23:09, Philippe Marschall <philippe.marschall at gmail.com> wrote:
> 
> 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?

I have no clue, no (I've never worked with either VA nor VW). I'll try to find out this morning.

> 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.

Yes, that sounds like a good idea. I don't have a clear picture of how your suggestion would be implemented with Grease. So if you could help me out there, I'd appreciated it.

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