cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Christopher Oliver <res1c...@verizon.net>
Subject Re: [flow] session creation
Date Tue, 15 Jul 2003 16:43:15 GMT
Jeremy Quinn wrote:

>
> On Tuesday, July 15, 2003, at 02:19 PM, Vadim Gritsenko wrote:
>
>> Christopher Oliver wrote:
>>
>>> Continuations do not require the session. But the session is needed 
>>> to support cases where you use JS global variables to share data 
>>> between multiple top level page flows.
>>
>
> <snip/>
>
>> Back to Antonio's suggestion. Can we have a configuration of the flow 
>> controller specifying where to store those global variables? Context, 
>> session, and request (that should be analogue to "no session", 
>> right?) can be possible values.
>
>
> I am using global variables in two situations ....
>
> 1. Static Variables
>
>     stuff like could easily be in the Application or Request Context:
>
>         var Beans = {
>               COVERAGE    : "org.iniva.archive.Coverage",
>               PERSON        : "org.iniva.archive.Person",
>               PROJECT        : "org.iniva.archive.Project",
>               RESOURCE    : "org.iniva.archive.Resource",
>               TYPE            : "org.iniva.archive.Type",
>               URL            : "org.iniva.archive.Url",
>               USER            : "org.iniva.archive.User"
>         } 

There's no need to store this elsewhere. It's already "stored" in your 
script.

>
>     
> 2. The User's login details
>
>     this could have been handled by an authentication Action in the 
> SiteMap, or even in the Container.
>
> While I do actually use Continuations in some functions, I strenuously 
> avoid keeping any other 'app state' in Global variables, so that the 
> user can have multiple browser windows open with different independent 
> tasks in progress in each one.

Not sure what you mean here. Using JS global variables makes it very 
easy to share state between page flows, for example in the Petstore the 
same Cart object is shared between various page flows:

- addToCart
- removeItemFromCart
- updateCart
- showCart
- checkout

Chris


Mime
View raw message