I'd like to create a container where it will allow ISomeService to be resolved, but not ISomeOtherService. Even though my registration for ISomeService depends on ISomeOtherService.
Does that make sense?
public interface ISomeService {}
public interface ISomeOtherService {}
public class SomeService : ISomeService
{
public SomeService(ISomeOtherService someOtherService) {}
}
public class SomeOtherService : ISomeOtherService {}
this container I'd like would resolve SomeService for ISomeService but if I tried to resolve ISomeOtherService or SomeOtherService it would fail.
Is that bad design?
So, a little context... I've got ASP.Net MVC Controllers that will be developed by various developers. Those controllers SHOULD have access to the application services like ISomeService but not to their dependencies. I'd like to avoid having to code review all of these services to make sure developers are not violating architecture design. They should be able to get references to ISomeService, but ISomeOtherService is a DB repository and they should never deal with it directly, but ISomeService does need this reference.
I don't mind hoping in the middle of the resolving (it's an ASP.NET MVC application and I have an extension point already for Controller creation) so I COULD take a look at the Controller being resolved, look at it's dependencies and ensure they're on a whitelist, but I don't know how to easily evaluate dependencies with Windsor. Or, would I just have to do it myself by looking at the constructor parameters?