cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Upayavira" ...@upaya.co.uk>
Subject Environments and the CocoonBean
Date Fri, 03 Jan 2003 11:22:14 GMT
Guys,

I have been trying more to get my head around the code I extracted from the 
Main.java class.

Firstly - environments:

The way the Main.java code works is that it creates an OutputStream outside of the 
FileSavingEnvironment, and hands this stream to this Environment. Cocoon then 
asks the FileSavingEnvironment for an OutputStream.

What I have done is implemented Destination classes, where this class provides an 
OutputStream customised for sending information by FTP, HTTP, etc.

However, it strikes me that this is the role of the Environment objects.

So, rather than have a Destination object hand its OutputStream to a 
FileSavingEnvironment, and that hand it to Cocoon, I would propose that I create an 
abstract BeanEnvironment class, and then subclass that as an FTPEnvironment, 
HTTPEnvironment (better name probably needed), FileSaveEnvironment, 
EmailEnvironment, etc, adding to these the behaviour that I originally had within my 
Destination classes.

Have I understood the role of the environment object correctly? I.e. it deals with a 
single request and the response to that request.

Regards, Upayavira

---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
For additional commands, email: cocoon-dev-help@xml.apache.org


Mime
View raw message