Return-Path: Delivered-To: apmail-xml-cocoon-dev-archive@xml.apache.org Received: (qmail 60003 invoked by uid 500); 19 Mar 2003 15:01:59 -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 59973 invoked from network); 19 Mar 2003 15:01:58 -0000 Received: from unknown (HELO rainbow.uk.volantis.com) (213.86.197.1) by daedalus.apache.org with SMTP; 19 Mar 2003 15:01:58 -0000 Received: from volantis.com (localhost.localdomain [127.0.0.1]) by rainbow.uk.volantis.com (8.11.2/8.11.2) with ESMTP id h2JF4cC10382 for ; Wed, 19 Mar 2003 15:04:38 GMT Message-ID: <3E788705.8050802@volantis.com> Date: Wed, 19 Mar 2003 15:04:37 +0000 From: Paul Duffin User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.0.0) Gecko/20020529 X-Accept-Language: en-us, en MIME-Version: 1.0 To: cocoon-dev@xml.apache.org Subject: Re: [proposal] fixing the encoding problems References: <3E7689E8.8010308@verizon.net> <3E76CE3E.9050901@apache.org> <3E76E8E8.6070001@apache.org> <3E76F15D.1070909@apache.org> <3E770B6F.5020904@apache.org> <3E77106D.8020004@apache.org> <3E78737D.9040706@apache.org> <3E787585.7030503@volantis.com> <3E7879A5.3060302@apache.org> <3E787D6B.5060404@apache.org> 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 Gianugo Rabellino wrote: > Stefano Mazzocchi wrote: > >> Paul Duffin wrote: >> >>> A problem that I ran into was that Serializers do not have access to >>> the environment (Request / Response). This means that it is very hard >>> to write sophisticated Serializers. >> >> >> >> For example? (I think FOP and batik are both pretty sofisticated >> serializers) > > > Well... not that much actually: they are both ~200 lines of Java code > and all they do is delegate to the underlying framework the XML events > grabbing an OutputStream to write to. Agreed, SLOC are a sloppy metric > but then again... > > The real keyword, however, is not "sophisticated" in an algotithmic > sense but "context aware": if a Serializer is not a > SitemapModelComponent than there is no way it can decide based on > context, be it a Request or any other information. We've been through > this many times, and I wander from one side to the other so I have no > clear decision in mind... > You are correct I meant context aware. >>> We worked around this by using it in conjunction with a Transformer >>> that was given the environment and simply passed it on to the >>> Serializer. >> >> >> >> The problem with having an environment-dependent serializer is that >> the cache needs access to it because it might change its behavior >> depending on environment parameters. > > > Can't parse this. Care to explain? > I guess the caching mechanism needs to decide whether the output from this request will be the same as the output from a previous request. If the output is context sensitive then the caching mechanism needs to use those parts of the request that affect the output as part of its key. However this problem applies to any site map components that are context sensitive, not just serializers. I presume (I have not used the cache) that this problem has been solved already. So while this possibly impacts the cost of making the changes it is not really an argument against allowing serializers to be context aware.