Return-Path: Delivered-To: apmail-cocoon-dev-archive@cocoon.apache.org Received: (qmail 66889 invoked by uid 500); 16 Jul 2003 12:07:42 -0000 Mailing-List: contact dev-help@cocoon.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: list-post: Reply-To: dev@cocoon.apache.org Delivered-To: mailing list dev@cocoon.apache.org Received: (qmail 66874 invoked from network); 16 Jul 2003 12:07:41 -0000 Received: from anchor-post-30.mail.demon.net (194.217.242.88) by daedalus.apache.org with SMTP; 16 Jul 2003 12:07:41 -0000 Received: from media.demon.co.uk ([80.177.14.141]) by anchor-post-30.mail.demon.net with esmtp (Exim 3.35 #1) id 19cl4P-000Gy4-0U for dev@cocoon.apache.org; Wed, 16 Jul 2003 13:07:41 +0100 Date: Wed, 16 Jul 2003 13:07:40 +0100 Subject: Re: [flow] session creation Content-Type: text/plain; charset=US-ASCII; format=flowed Mime-Version: 1.0 (Apple Message framework v552) From: Jeremy Quinn To: dev@cocoon.apache.org Content-Transfer-Encoding: 7bit In-Reply-To: <3F142F23.20708@verizon.net> Message-Id: <18D60CBA-B786-11D7-943E-0003935AD2EE@media.demon.co.uk> X-Mailer: Apple Mail (2.552) X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N On Tuesday, July 15, 2003, at 05:43 PM, Christopher Oliver wrote: > Jeremy Quinn wrote: > >> >> On Tuesday, July 15, 2003, at 02:19 PM, Vadim Gritsenko wrote: >> >> >> 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 In the Petstore app, it makes sense to only allow one instance of the store per user, so if they open another window they are still editing the same store. So in your case it makes sense to have the petstore as a global (HTTP Session) variable. In my application, I want people to be able to work on different parts of the application at the same time, independently of each other. In one window they may be working on 'Coverage' in another window they may be working on 'People', this is a design decision. Therefore in my case I must not keep 'the thing being edited' in a global variable. My externally invoked functions therefore always take an ID and TYPE parameter, so that this specific object can be retrieved for each function call. It is only when I have a Continuation that the specific Object is held in a variable, and then it is always a local one. Conversely, the logged in User object must be shared by all invocations, so this is a global. Hope this is clearer. regards Jeremy