cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Marcus Crafter <>
Subject Re: Flow wishlist :)
Date Wed, 27 Nov 2002 16:25:56 GMT
On Tue, Nov 26, 2002 at 08:35:53PM -0800, Christopher Oliver wrote:
> >>Flow is designed to simplify the sitemap
> >>by reducing the amount of routing components required and by moving
> >>business logic out of the sitemap.  Having global flow script variables
> >>available to routing components might encouarage users to move the
> >>flow/routing control back into the sitemap. Perhaps this is a "best 
> >>practice"
> >>issue, that we dont have to enforce?
> >>
> >>Ideally, with business logic moved to the flow controller, one would 
> >>only
> >>need to use selectors after a generator has been set.
> >
> >The need Marcus originally had was to access the values of the global 
> >variables of a flow script in the view layer. The idea is to avoid 
> >having to explicitly pass these values in the context object of 
> >sendPage*(). Instead one could use something like <jpath:value-of 
> >select="variableName" global="true"/>, where 'variableName' is a 
> >global variable in the flow scripts.
> >
> >These variables could be accessible to sitemap components, but they 
> >should not be abused. They should only be used during the View 
> >generation. They should not be used to do routing, e.g. in selectors 
> >and matchers.

	+1, I agree Ovidiu.

> Um, this sounds extremely bad to me. The use of global variables at all 
> should be discouraged in "flowscripts" for the usual reasons. Allowing 
> access to them in outside of the context of the script itself sounds 
> like an even worse abuse to me. Passing the objects you want to be 
> accessible to the view layer explicitly in sendPage*() was a better 
> design, in my opinion.

	hmm.. thanks for your input Christopher - this is interesting,
	because I find the ability to set globals in the flow script and have
	them automatically managed/stored in the session one of the big
	features of flow.
	The 'prefs' example shows how this can really be taken advantage of
	to store references to complex model objects that represent users,
	registries, etc.
	I just browsed over Ovidiu's slides from the GetTogether again,
	especially page 9.
	I think the issue comes down to whether data referenced by flowscript
	is only mean't to be accessable via the controller or not.
	ie. if one needs to need to get to a reference/data stored in
	global scope by step 2/3 (on page 9 in the slides above),
	must one always go through stage 1, even if it means writing a single
	line javascript method that does a simple sendPageAndContinue() to
	pass the required data back ?
	IMO, I'd like to have direct read only access in the
	JPathTransformer, or elsewhere, etc, because it would make sitemaps
	and/or session management smaller.


     ,,$$$$$$$$$,      Marcus Crafter
    ;$'      '$$$$:    Computer Systems Engineer
    $:         $$$$:   ManageSoft GmbH
     $       o_)$$$:   82-84 Mainzer Landstrasse
     ;$,    _/\ &&:'   60327 Frankfurt Germany
       '     /( &&&

To unsubscribe, e-mail:
For additional commands, email:

View raw message