Hi, I'm looking for some advice on how to best configure this situation. I have the following components in an ASP MVC application.
Controllers - Transient by requirement of MVC Services - Controllers call these to get to the business layer Validators - Services use these to validate components. These are expensive to create so I need them to be Singleton Repositories - Services and Validators use these to access data ISession - NHibernate Session configured as PerWebRequest I'm looking at how best to configure Services and Repositories. On the surface it seems like they could both be configured the same. Repositories only dependency (passed in on the constructor) is ISession. Services only dependencies (passed in on the constructor) are Repositories. When a Service needs a Validator it gets it from the ServiceLocator. Validators get Repositories in the constructor. I think that because Validators are Singleton passing Transient Repositories is problematic because the Validator will hold onto a Repository that has a disposed ISession. Any help here would be greatly appreciated. -- 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.
