Do we have any way to find/bind new implementations of interfaces at runtime? For example, say I write a module that has an interface called ISomeService. Say I have a couple default implementations in my module. In that module, I've got
a dropdown somewhere that allows users to select the implementation that they want for a specific content item.
Say that user wants to create their own implementation (not override, as you would with OrchardSuppressDependency), so they create a new implementation and I can include it as an option in the drop-down.
Basically, I'm looking for something like DependencyResolver.Current.GetServices<ISomeService>();
I'm not too familiar with Castle, however with Ninject I know you can do named binding. This would remove the need to being tied to having to save the fully qualified namespace/assembly/class or whatever. I could do something like this:
Bind<ISomeService>().To<MyImplementation1>().Named("Some sweet implementation");
Bind<ISomeService>().To<MyImplementation2>().Named("A really crappy implementation");
And you can access it like this:
kernel.Get<ISomeService>("Some sweet implementation");
Thoughts? Maybe I'm missing something, and there's some fantastic way to provide an extensibility point like this for modules.