cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
Subject C2 - casting to HttpEnvironment considered harmful
Date Tue, 25 Jul 2000 14:41:08 GMT

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.

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

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

- Sam Ruby

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

View raw message