i've been thinking about it a while and i'm still a bit confused why you 
feel that transient factories are a bad idea.  can you elaborate a bit on 
that?  if disposing the factory also automatically got released by the 
container, then you'd be able to create scoped lifestyles within the code 
very easily without referencing the container.

thanks.

On Wednesday, November 7, 2012 3:46:38 PM UTC-5, Krzysztof Koźmic wrote:
>
>  yes, two thoughts. 
>
> 1. The pattern you're using looks very odd. Why would you be creating the 
> factory in a using block?
> That seems to me like over complication.
> 2. That's how it was built to work, so I wouldn't call it a bug. You can 
> add another interceptor to the factory that will release it on dispose.
> However My recommendation would be to review your design first.
>
> HTH
> -- 
> Krzysztof Kozmic
>
> On Thursday, 8 November 2012 at 3:30 AM, bling wrote:
>
> any additional thoughts on this?  should i file a bug?  thanks.
>
> On Tuesday, November 6, 2012 5:17:48 PM UTC-5, Krzysztof Koźmic wrote:
>
>  disposing of the factory releases the objects the factory was tracking. 
> The factory itself is released as any other object.
>
> Why is that surprising?
>
> What is your actual scenario?
>
> -- 
> Krzysztof Kozmic
>
> On Wednesday, 7 November 2012 at 8:11 AM, bling wrote:
>
> public interface IFactory : IDisposable
> {
> }
>
> [Test]
> public void DisposedFactory_Should_Not_Be_Tracked()
> {
> var c = new WindsorContainer();
> c.AddFacility<TypedFactoryFacility>()
> .Register(Component.For<IFactory>().AsFactory().LifestyleTransient());
>
> var factory = c.Resolve<IFactory>();
> Assert.IsTrue(c.Kernel.ReleasePolicy.HasTrack(factory));
> factory.Dispose();
> Assert.IsFalse(c.Kernel.ReleasePolicy.HasTrack(factory));
> }
>
> this behavior is surprising to me....  short of writing an interceptor, is 
> there another way i can release the factory without referencing the 
> container?  thanks.
>
> -- 
> You received this message because you are subscribed to the Google Groups 
> "Castle Project Users" group.
> To view this discussion on the web visit 
> https://groups.google.com/d/msg/castle-project-users/-/dw_fOgOqghIJ.
> To post to this group, send email to [email protected].
> To unsubscribe from this group, send email to 
> [email protected].
> For more options, visit this group at 
> http://groups.google.com/group/castle-project-users?hl=en.
>  
>
>  -- 
> You received this message because you are subscribed to the Google Groups 
> "Castle Project Users" group.
> To view this discussion on the web visit 
> https://groups.google.com/d/msg/castle-project-users/-/DlvU3gutntAJ.
> To post to this group, send email to 
> [email protected]<javascript:>
> .
> To unsubscribe from this group, send email to 
> [email protected] <javascript:>.
> For more options, visit this group at 
> http://groups.google.com/group/castle-project-users?hl=en.
>  
>  
> 

-- 
You received this message because you are subscribed to the Google Groups 
"Castle Project Users" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/castle-project-users/-/mOvsYl0lPzkJ.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/castle-project-users?hl=en.

Reply via email to