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. In your cases, there are no shared variables or else there is only a single page flow.

So (can't test this now) does that mean that even currently, if instead of:


var role = Packages.org.apache.cocoon.caching.Cache.ROLE;
function cacheEvent() { ...

I do:

function cacheEvent() {
var role = Packages.org.apache.cocoon.caching.Cache.ROLE;
...

I skip the session?

I guess Stefano and Ricardo are arguing that in almost any real application that would not be the case.

And I totally agree, with the slight modification that not all flows in a real application will need to share global variables across multiple top level page flows.


In Ovidiu's original design you had to explicitly request use of the session in your script. Perhaps we should just turn that around and require you to explicitly request to _not_ use the session:

    function mySessionLessFlow() {
           cocoon.useSession = false;
           sendPageAndWait("blah.xml");
    }

What do you think?

I think this would work well. In this case it is the burden of the flow writer to explicitly claim that they don't need state.


I am not heavily into it yet, but I am starting to go through an application I wrote (in a frozen version of 2.1 dev) and upgrade to 2.1 beta/whatever and abolish all actions in favor of flow, and I am fairly confident that I'll be able to come up with some more useful cases that justify this. If there's strong feeling to the contrary though, I'd also be fine waiting to add this until I can prove it.

Geoff

Geoff Howard wrote:

Upayavira wrote:

I personally think that sessions should always be available from the flow, because I never felt the need to use flow without keeping some form of state but you seem to imply that your experience is different.

Can you show us how?




I have a simple site where I'm using flow (for the first time). It is a
single page site, with a form that the user can submit to change the info
presented on the page. The page uses SendPage(), and doesn't use
continuations, as all of the 'global' data is passed back and forward via
a form on the page itself. So no global variables are needed.
As no global variables are needed, no session is needed.


It's a pretty trivial example, but to my mind it is a site that uses flow
but doesn't need sessions. Or am I doing something wrong ;-)


Regards, Upayavira



I don't think I can add much to that - the trivial examples are the important ones in this case. The actual script I was working on at the time is the one in the eventcache block (which by the way is a confusing name - it's about uncaching with events). I posted it in this thread, but stripping it to the bones, it's just:


function func() {
  doSomeThing();
  sendPage(uri); _or_ redirectTo(uri)
}

No continuations in a perfect world should mean no session. Don't know nearly enough about the FOM implementation that Chris did (but I think it involves vodoo somewhere ;) ) to suggest whether that's technically feasible.

Geoff




Reply via email to