cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Sylvain Wallez <>
Subject Re: Better definition of the flow context?
Date Wed, 23 Feb 2005 16:49:30 GMT
Daniel Fagerstrom wrote:

> Carsten Ziegeler wrote:
>> Do we have a solid contract for our flow context object?
>> The FlowContextHelper returns an object, so e.g. in the jxtg we
>> have something like:
>>         if (contextObject instanceof Map) {
>>             map.putAll((Map)contextObject);
>>         } else if ( contextObject != null ) {
>>             fillContext(contextObject, map);
>>         }
>> to test whether the context is a map or a bean. Wouldn't it
>> be better/easier to require that the flow context is always a map?
> sendPage and sendPageAndWait can return any object, so it would 
> introduce back incompability. Even if I agree that it is somewhat 
> clumsy I don't think that it is enough reason for breaking peoples 
> code. So IMO we should keep it as is.

I don't think this should break much code, as that object (which BTW I 
prefer to name "view data" rather than the ambiguous "flow context" -- 
we have enough contexts in Cocoon) is supposed to be a JS object. And a 
JS object can easily be turned into a Map by associating property names 
to Map keys. We could even have a JSObjectMap that wraps a Scriptable as 
a Map.


Sylvain Wallez                                  Anyware Technologies 
{ XML, Java, Cocoon, OpenSource }*{ Training, Consulting, Projects }

View raw message