How do I dynamically point an interface to a specific class at runtime?
- by Jon
As a simple example, I have an xml file with a list of names of classes which actually carry out the work and all implement interface IDoWork with a method Process().
I loop through the items in the xml file.
How do I actually dynamically assign the class to the interface from a string name?
e.g.
var IDoWork = new "DoWorkType1"();
IDoWork.Process();
<work>
<item id="DoWorkType1">
</item>
<item id="DoWorkType2">
</item>
</work>
I want to achieve a plugin type architecture, except the plugin isn't at an assembly level only a class level within my program.