Return-Path: Delivered-To: apmail-xml-cocoon-dev-archive@xml.apache.org Received: (qmail 30568 invoked by uid 500); 3 Mar 2003 22:45:37 -0000 Mailing-List: contact cocoon-dev-help@xml.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: list-post: Reply-To: cocoon-dev@xml.apache.org Delivered-To: mailing list cocoon-dev@xml.apache.org Received: (qmail 30554 invoked from network); 3 Mar 2003 22:45:37 -0000 Received: from out005pub.verizon.net (HELO out005.verizon.net) (206.46.170.143) by daedalus.apache.org with SMTP; 3 Mar 2003 22:45:37 -0000 Received: from verizon.net ([4.46.80.164]) by out005.verizon.net (InterMail vM.5.01.05.27 201-253-122-126-127-20021220) with ESMTP id <20030303224542.DFXE6910.out005.verizon.net@verizon.net> for ; Mon, 3 Mar 2003 16:45:42 -0600 Message-ID: <3E63DB0E.4020408@verizon.net> Date: Mon, 03 Mar 2003 14:45:34 -0800 From: Christopher Oliver Reply-To: coliver@apache.org User-Agent: Mozilla/5.0 (Windows; U; WinNT4.0; en-US; rv:1.0.1) Gecko/20020823 Netscape/7.0 X-Accept-Language: en-us, en MIME-Version: 1.0 To: cocoon-dev@xml.apache.org Subject: Re: Flow result storage : let's fix it before its too late ! References: <3E63D5E6.6010007@anyware-tech.com> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Authentication-Info: Submitted using SMTP AUTH at out005.verizon.net from [4.46.80.164] at Mon, 3 Mar 2003 16:45:42 -0600 X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N First of all Sylvain, my name is Chris Oliver, not Andrew C. Oliver (that's acoliver@apache.org). Sylvain Wallez wrote: > Hi all, > > A rather provocative subject, so let me first say that I like the flow, > even if unfortunately I didn't have the occasion to use it up to know. > Ovidiu did a wonderful job and Adrew is now adding features that make it > more usable. > > But I think we reached a point where we have to be careful at how the > flow is slowly spreading inside other components and do some design > before it's too late. I'm glad I've stimulated your interest. That was my intention - even if you choose to cast it in terms of a perceived lack of design. The changes I've made are not written in stone. On the contrary, I expect them to change based on observations by others, including yours. > This is mainly about the way the flow gives its > output to other components : it adds two attributes to the *Environment* > object, which is an object used internally by the pipeline machinery, > and *should not be used* by other components (nor shoud it > theroretically be accessible). > > The way this Enviromnent object is fetched says it by itself : > public void setup(SourceResolver resolver, Map objectModel, String src, > Parameters params) { > Object bean = ((Environment)resolver).getAttribute("bean-dict"); > WebContinuation kont = > (WebContinuation)((Environment)resolver).getAttribute("kont"); > ... > > This is a hack that relies on the fact that the SourceResolver also > implements Environment, which is absolutely not guaranteed by its > contract ! Furthermore, this "resolver" parameter in C2.1 should be > considered deprecated and is replaced by the Excalibur SourceResolver > which is a regular component looked up on the ComponentManager and > doesn't implement Environment ! I agree with you here. It should be no big deal to move the storage of these values to the objectModel. > > So why don't we use the ObjectModel to pass the flow information ? It > already contains the request and the response, and this seems the > natural place for flow values. And more : if we consider components such > as FlowVelocityGenerator, why would we want to publish only flow data > and not elements of the object model ? If everything was in the object > model, we could have some generic publication code that would publish > all that is in the object model, regardless of what it actually is, and > thus no need for a second VelocityGenerator. Well, actually I don't agree with you now. The flow script establishes a contract with the presentation layer determined by the object it passes to sendPage*() or the object it uses for the XMLForm model. This, and only this, should be supplied to the presentation layer. The presentation layer should not have access to the request, session, etc, unless references to these are explicitly passed by the flow script. > > Thoughts ? What's the reason for using the Environment ? > > Also, I prefer longer but more explicit names than "$this" to access the > flow bean : "$flowDict" is not much longer but way more explicit in the Actually, under normal circumstances you never need to use $this. Its only reason for existence is to provide a means of disambiguating the built-in "continuation" property, in case the bean also has a property called "continuation": $continuation - the continuation object $this.continuation - a property named "continuation"