cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Carsten Ziegeler" <cziege...@s-und-n.de>
Subject RE: [RT] Access to the object model
Date Mon, 19 May 2003 13:15:23 GMT

Peter Royal wrote:
> 
> 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" );
> 
I'm not sure if this is working. A component can be thread safe,
but each request has an own object model, so I think at least the context
must either be thread local (which would not be that efficient) or
you must store some kind of thread handler for the object model
in the context. Or do I oversee something?

Carsten

Mime
View raw message