cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Peter Royal <pro...@apache.org>
Subject Re: [RT] Access to the object model
Date Mon, 19 May 2003 13:03:28 GMT
On Monday, May 19, 2003, at 06:14  AM, Carsten Ziegeler wrote:
> c) Use the Contextualizable interface and put a "handler" in
>    the context object.
>
> Now, the most simple approach is a), but that'S not IoC. - I
> think the cleanest solution is b), but that would require
> a new marker interface.
>
> I currently tend to a),
>
> What do you think? Is is bad to get the object model in
> a custom component?

I'd say (c).

You could do a straight dump of the object model into a Context..

final DefaultContext objectModelContext = new DefaultContext( 
objectModel, parentContext );

ContainerUtil.contextualize( objectModelContext, component );

....

Components then just do:

Request req = (Request) context.get( "request" );

-pete


Mime
View raw message