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:50:51 GMT
Sylvain Wallez wrote:
> >I totally agree with you and actually I wanted to provocate a 
> reaction or answer why the static method is really that bad.
> >
> Because static methods give the feeling of some global variable, even if 
> a ThreadLocal actually hides behind it.
Yes, using a ThreadLocal it's not that static any more.

> >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".
> >
> Mmmh... yes, it's not IoC. I don't have anything else but bad feelings 
> about static methods for now, but I'm wondering how this will fit with 
> blocks : the strong separation between blocks may lead us to want 
> different environments between different blocks, and having a single 
> static entry point may make it difficult to implement cleanly this 
> separation, while - each block having its own container - going through 
> the Context will make it trivial and controlled.

> >I personally would like to have both ways: using the context 
> (=IoC) and also the static way for places where IoC is not possible.
> >  
> >
> Ah, so next problem : where isn't IoC possible ?
:) I knew you would ask this, so ehm..yes..

Now, I personally like writing simple code, so I like writing a component
that stores some data in the object model. Now, in order to retrieve
the data, I don't want to lookup the component again, but I want
to directly query the object model for it. So, I guess, it's my 
personal problem and it enforces you to always use components to
get and set data. And I guess, I'm the only one again who wants to
have more freedom when writing code...

So, what about implementing this Context thing then?


View raw message