[picocontainer-dev] New Picocontainer-web ... defeating IoC made easier now :-(
Paul Hammant <[email protected]>
| Newsgroups | gmane.comp.java.picocontainer.devel |
|---|---|
| Message-ID | <[email protected]> |
In PicoServletContainerFilter, there is ..
public static MutablePicoContainer getRequestContainerForThread()
{ .. }
.. which makes available a request container for our classes
ActionFactory (Struts1)
PicoObjectFactory (Struts2)
PicoActionFactory (Webwork1)
PicoObjectFactory (WebWork2)
The problem is that actions themselves could call that static method
to get a container. You could make it policy in a dev team not to, but
PicoContainer is normally more protected than this. IoC is normally
guaranteed.
I thought about a solution changing the method to ..
public static MutablePicoContainer
getRequestContainerForThread(String magicKey) { .. }
And make all of the bits be aware of some value set in web.xml or
struts.xml (you get the picture), but not all of those four classes
can recieve config or reach back to getInitParameter(.) - so it isn't
going to work.
Thoughts?
- Paul
---------------------------------------------------------------------
To unsubscribe from this list, please visit:
http://xircles.codehaus.org/manage_email