Hi,
I've inherited a legacy application which used/abused Unity (instantiating a Unity container on every request, then stashing things in it that needed to be scoped to the lifetime of the request - ouch!) This all seems a bit wasteful to me, when I could just use Castle Windsor with the PerWcfRequest lifestyle.
The legacy system uses a custom ServiceHostFactory to add an IAuthorizationPolicy implementation to the ServiceHost and to instantiate and hook up the Unity container.
The AuthorizationPolicy has a concrete dependency on another class which does all the database lookups + caching information about the user. Is there an elegant way to inject this dependency in the constructor of the AuthorizationPolicy without having to introduce a dependency on the IOC container and using the Service Locator AntiPattern?
Or should I stop worrying and just implement the damn thing?
Thanks,
Dan