cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Antonio Gallardo" <agalla...@agsoftware.dnsalias.com>
Subject Re: [flow] session creation
Date Tue, 15 Jul 2003 17:37:36 GMT
Jeremy Quinn dijo:
>
> 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"
> 	    }

This type of static variables are true constants?
If this is true, then we are talking about constants and not about global
variables.

>
> 2. The User's login details
>
> 	this could have been handled by an authentication Action in the
> SiteMap, or even in the Container.
Yep, but this is related to the user. There are not global variables at
the high level.

>
> 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.
>
> If there are going to be ways of externally configuring how Global
> Variables are stored, I think we need to take into account a possible
> need to store different variable sets in different ways.
>
> I do not believe that a global setting in Cocoon.xconf would be a good
> idea though, I will have multiple FlowApps in one Cocoon Instance, they
> by no means would want to share the same settings.

I agree with you.
Thiere is one OO rule: Avoid the use of global variables.

Best Regards,

Antonio Gallardo.




Mime
View raw message