Return-Path: Delivered-To: apmail-cocoon-dev-archive@www.apache.org Received: (qmail 9610 invoked from network); 9 Dec 2004 14:11:40 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur-2.apache.org with SMTP; 9 Dec 2004 14:11:40 -0000 Received: (qmail 73704 invoked by uid 500); 9 Dec 2004 14:11:33 -0000 Delivered-To: apmail-cocoon-dev-archive@cocoon.apache.org Received: (qmail 73639 invoked by uid 500); 9 Dec 2004 14:11:33 -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 73623 invoked by uid 99); 9 Dec 2004 14:11:32 -0000 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received-SPF: pass (hermes.apache.org: local policy) Received: from essemtepe.nada.kth.se (HELO smtp.nada.kth.se) (130.237.222.115) by apache.org (qpsmtpd/0.28) with ESMTP; Thu, 09 Dec 2004 06:11:31 -0800 X-Authentication-Info: The sender was authenticated as danielf using PLAIN at smtp.nada.kth.se Received: from nada.kth.se (cvap80.nada.kth.se [130.237.218.93]) (authenticated bits=0) by smtp.nada.kth.se (8.12.11/8.12.11) with ESMTP id iB9EBSIF001039 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Thu, 9 Dec 2004 15:11:28 +0100 (MET) Message-ID: <41B85D10.6020003@nada.kth.se> Date: Thu, 09 Dec 2004 15:11:28 +0100 From: Daniel Fagerstrom User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.4.2) Gecko/20040308 X-Accept-Language: sv, en-us MIME-Version: 1.0 To: dev@cocoon.apache.org Subject: Re: [RFC] JXTG Refactoring References: <802926B6AB8533408C33ADBCA3EE5C2AAD98E4@coso.staff.vuw.ac.nz> <41B771BD.6040707@mobilebox.pl> <41B80E08.1090905@nada.kth.se> <41B810B4.4000005@mobilebox.pl> <41B8145E.6070504@mobilebox.pl> <35055.10.0.0.5.1102583058.squirrel@www.agssa.net> <41B815CB.9030502@mobilebox.pl> <41B82E1D.6020203@nada.kth.se> <41B847CE.9060807@mobilebox.pl> In-Reply-To: <41B847CE.9060807@mobilebox.pl> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N Leszek Gawron wrote: > I have commited an initial JXTemplateGenerator to > o.a.c.template.jxtg.JXTemplateGenerator and moved Jonas' templating > proposal to o.a.c.template.v2 package. > > Please review. Nice! Don't have time to review in any detail right now. I added some basic test cases. Two of them that tries to test that the cocoon object is accesible from expressions are faulty, I didn't get them to work even with the original JXTG, any idea about what goes wrong? --- o0o --- For further refactoring I think that we should try to factor out the execute method as you certainly have seen it is quite intermingled with other stuff. IMO it should be static (or better moved to an own class), and depend of three arguments: execute(XMLConsumer consumer, ExecutionContext context, ...) where ExecutionContext is a new class containing the jexl and jxpath contexts, ServiceManager (and SourceResolver but that is accesible from ServiceManager), Variables, cache and definitions. There was some discussion about context in http://marc.theaimsgroup.com/?t=110173410800002&r=1&w=2. In a next step the cache object should be factored out from the ExecutionContext and replaced by some kind of script manager, so that we can have the code that compiles and caches the scripts at one place. Then execute takes a number of events as arguments, I would like to abstact the coupling between execution and event implementation, but how it should be done requires more thinking. Each tag has code in three places: its start tag that contains data, in the parser for setting it up and inexecute for executing it. That is rather confusing, so we shoud put all the three parts in one class. How this can be done has been discussed in the above thread among other places. Hiding the jxpath and jexl specifc code beyond one interface would also be nice. WDYT? /Daniel