Return-Path: Delivered-To: apmail-xml-cocoon-dev-archive@xml.apache.org Received: (qmail 5994 invoked by uid 500); 8 Jan 2003 23:00:08 -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 5983 invoked from network); 8 Jan 2003 23:00:07 -0000 Message-ID: <3E1CADE1.5090904@apache.org> Date: Wed, 08 Jan 2003 15:01:53 -0800 From: Stefano Mazzocchi User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.2.1) Gecko/20021130 X-Accept-Language: en-us, en MIME-Version: 1.0 To: cocoon-dev@xml.apache.org Subject: Re: [Flow]: Modularizing flow scripts References: <3E1C5AF9.2060808@cbim.it> In-Reply-To: <3E1C5AF9.2060808@cbim.it> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N Ugo Cei wrote: > Giacomo Pati wrote: > >> On Wed, 8 Jan 2003, Ugo Cei wrote: >> >>> My flowscript is getting big, and I've coded just a fraction of the >>> functionality of my app. >> >> What is big for you in terms of lines? >> > > The one I'm currently working on is about 300 lines and I'm starting to > feel unconfortable about it. The problem is that this script contains > just some minimal user management functions and now I'd like to start > adding some application-specific functions. I'd rather not keep them > together, considering also the fact that I might wnat to reuse the > user-management functions in another app. > > > I thought a flowscript would be small and logic is modularized into Java > > classes. > > Mostly it is, but each function has (typically) to: > > - check some preconditions (is the user logged in, is she authorized?) > - initialize or retrieve some domain objects > - invoke a view (typically a form) > - retrieve data from the posted form > - validate them > - store the domain object > - maybe do the same for one or more other forms in a sequence > - handle exceptions > - etc. > > So, even putting most of the code in Java classes, we're still talking > of a screenful of lines per function. And in some applications, you > might have tens, if not hundreds of them. Just FYI, JavaScript has the ability to pass a function as a parameter of another function. That makes a pretty light and cheapo aspect-orientation way. -- Stefano Mazzocchi -------------------------------------------------------------------- --------------------------------------------------------------------- To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org For additional commands, email: cocoon-dev-help@xml.apache.org