cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Carsten Ziegeler" <>
Subject RE: [RT] Access to the object model
Date Wed, 21 May 2003 09:15:48 GMT
Sylvain Wallez wrote:
> >>I even find it cleaner than having to pass the object model as 
> a parameter down to components that need it, eventually having to 
> pass it through components that absolutely don't care about it. 
> And if the call chain goes through components that don't allow 
> the transmission of the object model, then you're stuck to the 
> ugly CocoonComponentManager.getCurrentEnvironment().getObjectModel().
> >>    
> >>
> >Yes, and this is exactly one of my points, adding the object 
> model to the signature of a component doesn't make sense. On the 
> other hand, you need the object model in some implementations.
> >
> >I think a simple ObjectModelHelper.getObjectModel() would do the 
> trick for now :)
> >
> >(Let the flame war start...)
> >
> Ermh... is it really cleaner than the CocoonComponentManager hack ?
Yes, it's an official api :-)

> If we are to officially generalize access to the object model, I'd like 
> it to be done in a clean way, and using the Context seems better to me.
I totally agree with you and actually I wanted to provocate a reaction
or answer why the static method is really that bad. Now, I know, IoC is
great and I have the *feeling* that the static approach is not good,
but I don't have a real reason other than saying: "It's not IoC".

I personally would like to have both ways: using the context (=IoC) and
also the static way for places where IoC is not possible.


View raw message