cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Sylvain Wallez <sylv...@apache.org>
Subject Re: Hiding business logic in flow: how to get at naked request?
Date Fri, 26 Dec 2003 08:43:16 GMT
Christopher Oliver wrote:

> Sylvain Wallez wrote:
>
>> There is a way. Not that straightforward, though.
>>
>> You should use the new cocoon.createObject(classname) method that 
>> instanciates an object and goes through the various lifecycle 
>> interfaces. Your class has to be Contextualizable, and you can then 
>> get the request from the context using 
>> ContextHelper.getRequest(context).
>>
>> Now I agree with you that having a restricted object model in the 
>> flow is too much constraining.
>>
>> Sylvain
>
> One way to make this easier would be to make 
> FOM_Request/Response/Session/Context implement the 
> Request/Response/Session/Context interfaces. These interfaces would 
> not be accessible in JS code but would be in Java code.


Great idea! This will greatly ease the communication between flowscript 
and Java classes.

> The only drawback is for code that attempts to downcast e.g. Request 
> to HttpRequest which would not work. Since HttpRequest is a class, not 
> an interface, it cannot be implemented by FOM_Request. Given that is 
> the case, such downcasting is probably a Bad Thing (TM) anyway.


Agree.

Sylvain

-- 
Sylvain Wallez                                  Anyware Technologies
http://www.apache.org/~sylvain           http://www.anyware-tech.com
{ XML, Java, Cocoon, OpenSource }*{ Training, Consulting, Projects }
Orixo, the opensource XML business alliance  -  http://www.orixo.com



Mime
View raw message