Spring.net - how to choose implementation of interface in runtime ?
- by rouen
Hi,
in all examples of spring.net IoC i can see something like this:
interface IClass;
class ClassA : IClass;
class ClassB : IClass,
and then in config.xml file
something like
[object id="IClass" type="ClassB, Spring.Net.Test" /]
but, i really need to do something like this:
in config file there will be more implementations if interface:
[object id="IClass" type="ClassA, Blah" /]
[object id="IClass" type="ClassB, Blah" /]
and then, in runtime i choose from them, something like this:
IClass c = [get me all implementations of IClass, and choose the one with GetType().FullName == myVariableContainingFullTypeNameOfObjectIWant]
how can i do something like this please, i cant google anything for hours....
many thanks !