cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Sylvain Wallez <>
Subject Re: [RT] Access to the object model
Date Tue, 20 May 2003 07:41:58 GMT
Carsten Ziegeler wrote:

>Stefano Mazzocchi wrote:
>>on 5/19/03 9:37 AM Carsten Ziegeler wrote:
>>>Yes, I currently don't know which way is better. Using Context and
>>>Resolvable is somehow cleaner (IoC), but the static version is very
>>>simple. Hmm, has anyone else an opinion?
>>Question: why do you need this in the first place?
>At least there are two cases where I need the object model:
>a) to get information about the current request, so basically getting the current request/response
object and any other information stored in the object model
>b) to store information on a per request base, so basically using the request attributes
to store/retrieve information
>I think for developing components those two things are very useful and needed.

Another use case : in the CVSSource, user credentials are accessed using 
a sitemap-like expression allowing the use of input modules (see [1]). 
This avoids having a fixed scheme and also avoids to transmit these 
credentials all along the chain from the sitemap down to the source, 
which BTW is not always possible (e.g. XSLT URIResolver)

But for this to function properly, there must be a way to access the 
object model since input modules use it. So the CVSSource uses the 
CocoonComponentManager.getCurrentEnvironment() hack.

Now if the object model was accessible through the context, input 
modules using it (not all do) could access it directly avoiding the need 
for the CVSSource to care about it. Moreover this would allow to remove 
the object model from the InputModule interface, thus potentially 
broadening the use of modules not using the object model outside of 
Cocoon, or in places in Cocoon where the object model is not "naturally" 
available (e.g. expanding variables in xconf files, etc).



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

View raw message