Personally I try to avoid singletons as much as possible. notice that you can't really have a singleton be dependant on a transient/per-thread/per-request component. that's cuz the singleton will have that dependency fulfilled, and on the next request, the old transient component will be re-used as the singleton is still alive.
so singletons only make sense on the edge of the dependency tree. and since the nature of using Windsor is that it's so automatic you tend to forget it's there, so you end up adding a dependency from the singleton on a transient component, and BAM - you start having 'weird' lifecycle issues, then you get angry, then you call Castle's customer service to get your money back. On Wed, Sep 3, 2008 at 8:41 AM, Tuna Toksöz <[EMAIL PROTECTED]> wrote: > It creates only if there is a demand. Unless you ask container to resolve > one, you won't get anything. > > Tuna Toksöz > > Typos included to enhance the readers attention! > > > > On Wed, Sep 3, 2008 at 12:40 AM, Jan Limpens <[EMAIL PROTECTED]>wrote: > >> >> A normally registered service in Windsor seems to life as a singleton. >> In a web application, it looks like a good pattern to pass a service >> nothing (or very little else) than other services that also can be >> resolved by the container. Anything with weight you pass in the >> service's methods. So the services, even as singletons are very >> light-weighted. >> >> Still the singleton nature worries me a bit. How do you handle this? >> What lifecycles do you use for which kinds of services? >> Does PerWebRequest really create an instance on every web request or >> only if there is demand? How does this affect performance? >> >> -- >> Jan >> ___________________ >> [EMAIL PROTECTED] >> www.limpens.com >> +55 (11) 3082-1087 >> +55 (11) 3097-8339 >> >> >> > > > > -- Ken Egozi. http://www.kenegozi.com/blog http://www.musicglue.com http://www.castleproject.org http://www.gotfriends.co.il --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Castle Project Users" 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-users?hl=en -~----------~----~----~----~------~----~------~--~---
