Suppose I have Class1, Class2, and Class3. Class2 is just a container of information. At runtime I want Class1 to look into the contents of Class2, find Class3, and instantiate an instance of Class3.
For this, I DO NOT WANT class2 to have an instance of class3, and I do not want class2 to have any code/knowledge of what class3 is going to do. In theory, I want Class2 to have a field which gives a type that implements a specified interface that allows Class1 to call it.
Is there a way to do this?