cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ricardo Rocha <>
Subject Re: Change of the Environment abstraction
Date Thu, 03 Aug 2000 13:57:35 GMT
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()).
> . . .<skip/>
> 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.
> . . .<skip/>
>    We add:
>      public Dictionary getObjectModel();
>    to the Environment interface.
> . . .<skip/>

Currently, Generators, Transformers, Serializers and Readers are all
passed the Environment object as argument to their setup/generate

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
purposes the Environment abstraction was conceived for in the first

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).

View raw message