Seems like a standard approach for an ioc when given a scenario like (C# windsor):
container.AddComponent<ILogger, HttpLogger>();
container.AddComponent<ILogger, SmtpLogger>();
var logger = container.Resolve<ILogger>();
Would be that when resolving the component, the first registered ILogger (HttpLogger in this case) is the only candidate for resolution, the ioc will then find the 'fattest' constructor it can where it believes it can resolve all the dependencies.
However, it may well be the ioc cannot resolve the dependencies for the first logger, and will thusly return with a resolution issue, it could well be the case that the SmtpLogger COULD have been resolved if the ioc tried it.
So what is the reasoning for only using the first registered service as the candidate? it seems that the uncertainty of which type you will get is an argument, but then the ioc is being left in charge of which constructor that it uses anyway.
So why not pick from all the constructors of all applicable types, and start trying to resolve from the fattest constructors down (agnostic of the real type)?
This may have a really obvious answer but honestly I don't know it.
Thanks in advance, Stephen.