Re: [picocontainer-dev] New Picocontainer-web ... defeating IoC made easier now :-(
Paul Hammant <[email protected]>
| Newsgroups | gmane.comp.java.picocontainer.devel |
|---|---|
| Message-ID | <[email protected]> |
That would work, but its not regular practice having multiple jars
with classes having the same package. I.e. the same package existing
in multiple jars.
They are mutually exclusive though.
- Paul
On Jun 14, 2008, at 8:31 PM, Michael Rimov wrote:
>
>> 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) { .. }
>
> Seems a little complicated for what you're gaining... especially
> since it
> requires additional web.xml/struts.xml configuration.
>
>
> 1/2 hearted solution:
>
> How about making it package protected instead? Make all factories
> that grab it
> inside the same package.
>
> StrutsActionFactory (Struts1)
> StrutsObjectFactory (Struts2)
> WebworkActionFactory (Webwork1)
> WebworkObjectFactory (WebWork2)
>
> If somebody is going to break the data hiding then they're at least
> going to see
> a warning sign (non-public method) before attempting it.
>
> -Mike
>
>
> ---------------------------------------------------------------------
> To unsubscribe from this list, please visit:
>
> http://xircles.codehaus.org/manage_email
>
>
---------------------------------------------------------------------
To unsubscribe from this list, please visit:
http://xircles.codehaus.org/manage_email