cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Giacomo Pati <pati_giac...@yahoo.com>
Subject Re: C2 - casting to HttpEnvironment considered harmful
Date Tue, 25 Jul 2000 15:39:35 GMT

--- rubys@us.ibm.com wrote:
> 
> 
> Perhaps I am just missing the big picture.
> 
> Cocoon2 is supposed to work in multiple environments - as a servlet
> and
> from the command line are two examples.  Seeing each of the
> serializers
> casting the environment to HttpEnvironment without so much as a check
> seem
> to me to be a bad thing.

The idea to cast them came from Ricardo (if I remembered correctly).
You're right they should check them with instanceof and I appology
beeing too lazy not done so.

But I'm happy someone picks up a dialog :)

> I see at least two ways to address this.
> 
> 1) Add methods to the Environment interface which do commonly
> required
> functions (like setting the contentType).  Have each environment do
> the
> appropriate thing.  Eliminate the cocoon.Request and cocoon.Response
> classes.

The Environment Interface so far addresses only functionality used in
the new sitemap engine. No problem to extend it if you think it's
better to implement it on the base Interface instead of the concrete
class (HttpEnvironment in this case).

> 2) move the getRequest and getResponse methods from HttpEnvironment
> to
> environment, and change the type they return to be cocoon.Request and
> cocoon.Response.

The fact ist is not there is simply because it is not needed by the
core cocoon sitemap engine. Only the components deal with
Request/Response/Context.

> P.S.  The reason I am interested is that I gave a demo last week of
> Cocoon
> and PHP integration - but to make it work I had to make a hack to get
> the
> path names to resolve correctly.  Now I am interested in seeing the
> right
> fix get into the base and I find the system in transition.  I am
> willing to
> make the necessary changes to get the system back up and running, but
> I
> don't want to duplicate anybody's work or evolve the system in the
> wrong
> direction.

Any help would be very appriciated. I would be happy you could take
care of properly integrating the Environment stuff. Originally the idea
came from Ricardo but he hadn't the time to implement it and I wanted
something working while integrating the new sitemap engine. 

There was even the idea to integrate a Context object into the
Environment which I have done but not yet commited.

TIA 

Giacomo

=====
--
PWR GmbH, Organisation & Entwicklung      Tel:   +41 (0)1 856 2202
Giacomo Pati, CTO/CEO                     Fax:   +41 (0)1 856 2201
Hintereichenstrasse 7                     Mailto:Giacomo.Pati@pwr.ch
CH-8166 Niederweningen                    Web:   http://www.pwr.ch

__________________________________________________
Do You Yahoo!?
Get Yahoo! Mail  Free email you can access from anywhere!
http://mail.yahoo.com/

Mime
View raw message