Re: [picocontainer-dev] Builder confusion and cycles in annotation
Jörg Schaible <[email protected]>
| Newsgroups | gmane.comp.java.picocontainer.devel |
|---|---|
| Message-ID | <[email protected]> |
Paul Hammant wrote:
>
> On Jun 15, 2007, at 10:00 AM, Putrycz, Erik wrote:
>
>> Hi Paul
>>
>>> What the problem we're trying to solve though there ?
>>
>> This is in my test cases
>> @Single
>> public class CircularCat {
>> @Inject
>> private CircularMouse mouse;
>>
>> }
>>
>>
>> @Single
>> public class CircularMouse {
>>
>> @Inject
>> private CircularCat theCat;
>>
>> }
>>
>
> Yup. Its the same case as we've mulled for years (though I personally
> don't see Cat/Mouse classes ;). There are too many downsides to
> allowing circular refs for Annotation, Field, Setter (or Getter) DI.
> Most enterprises are trying to extinguish circular refs as they move
> from Singleton Hairball to decomposed DI solution.
>
> It might be good to allow, some mechanism in Pico-gems that enhances
> (somehow) the ComponentInjectors to not barf on circular. Building on
> HotSwappingBehaviorAdapter perhaps. Meaning its an explicit choice
> for people using Pico.
It works for the HotSwappingCA and IIRC also for the ImplHidingCA. At least
the HSCA's unit tests have Aslak's Yin/Yan sample.
[snip]
- Jörg
---------------------------------------------------------------------
To unsubscribe from this list please visit:
http://xircles.codehaus.org/manage_email