Return-Path: Mailing-List: contact cocoon-dev-help@xml.apache.org; run by ezmlm Delivered-To: mailing list cocoon-dev@xml.apache.org Received: (qmail 75973 invoked from network); 3 Aug 2000 13:57:06 -0000 Received: from cr2167258121.cable.net.co (HELO ricardo) (root@216.72.58.121) by locus.apache.org with SMTP; 3 Aug 2000 13:57:06 -0000 Received: from apache.org (IDENT:ricardo@localhost.localdomain [127.0.0.1]) by ricardo (8.9.3/8.8.7) with ESMTP id IAA01444 for ; Thu, 3 Aug 2000 08:57:36 -0500 Sender: ricardo@ricardo Message-ID: <39897A4F.8C756AF5@apache.org> Date: Thu, 03 Aug 2000 08:57:35 -0500 From: Ricardo Rocha Organization: Plenix X-Mailer: Mozilla 4.61 [en] (X11; I; Linux 2.2.12-20 i686) X-Accept-Language: en MIME-Version: 1.0 To: cocoon-dev@xml.apache.org Subject: Re: Change of the Environment abstraction References: <398966DA.46FFAEBE@pwr.ch> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Spam-Rating: locus.apache.org 1.6.2 0/1000/N Giacomo Pati wrote: > 1. The output stream is a property of the calling environment and should > be made available only through it (as opposed to a separate argument > as seen in the current implementation of Cocoon.process(), > SitemapManager.invoke() or sitemapHandler.process()). > . . . > 3. Every Environment has an associated object model expressed as a > collection of named objects whose names and types vary from > environment to environment. Instead of defining environment-specific > get[Object]() methods, it's more general to define a higher-level > Environment.getObjectModel() method that returns a Dictionary of > objects making up the model. > . . . > We add: > public Dictionary getObjectModel(); > to the Environment interface. > . . . Currently, Generators, Transformers, Serializers and Readers are all passed the Environment object as argument to their setup/generate methods. It appears to me that Generators and Transformers should NOT have access to the Environment as a whole but _only_ to its object model. If we give these processors access to the environment, they could (for instance) manipulate the output stream directly, thus defeating one of the purposes the Environment abstraction was conceived for in the first place. What these classes really need, I think, is access to the Environment's _object model_. For example: In the HttpEnvironment, Generators (and XSP pages) need access to servlet objects like "request", "context", etc. Transformers may also need access to the HttpRequest... Serializers (and Readers), on the other hand, need access to the Environments's output stream. I can't see now why these processor types should need access to the object model, though it may well be the case (those of you who see a need for this, please enlighten me). Thus, I think Serializers and Readers should be passed the Environment's output stream only, instead of the Environment object as such (or its object model).