Sorry to enlarge the discussion, but is that desirable behaviour? Long running processes may wish to recycle singletons without recycling the container. I accept that child containers can achieve a similar result, but there's a couple of difficulties. One is that there doesn't seem to be a way to distinguish between true singletons and child container specific scope, which limits its utility. A more general point is that Dispose is the way C# developers naturally release resources. Indeed, the tutorial example can in fact be correctly expressed using a Dispose, although currently that wouldn't necessarily scale. A third is that by separating out the interfaces for registration and resolution, it would be clearer what the responsibilities of the developer were.
Julian. 2009/3/6 hammett <[email protected]> > > Yep. That's right. > > On Thu, Mar 5, 2009 at 3:50 PM, Bill Pierce <[email protected]> wrote: > > > > I haven't been in the code in a while but I'm 92% sure Release knows > > what needs to be done so that you can always call it without worry > > i.e. releasing a singleton is a no op. > > > > On Thu, Mar 5, 2009 at 3:25 PM, Bill Barry <[email protected]> > wrote: > >> > >> Bill Pierce wrote: > >>> If you new a disposable object, you should dispose that object. > >>> If you resolve a component, you should release the component. > >>> > >>> MyPage did not call resolve, so it should not be concerned with calling > release. > >>> > >>> If FrameworkInitialize is resolving components, then you should have a > >>> FrameworkTeardown to release the components. > >>> > >> Are you supposed to release singletons? What about per-thread objects or > >> objects in a custom lifecycle? > >> > >> > > >> > > > > > > > > > > > --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Castle Project Development List" group. 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-devel?hl=en -~----------~----~----~----~------~----~------~--~---
