posted 12 years ago
Say we have following class definition
public Class MyClass1{
private ParentClass1 parentInstance;
public MyClass1(ParentClass1 instance)
{
this.parentInstance=instance;
}
}
Now we have five child class which extends ParentClass1. Now in spring when are composing MyClass1 ,how we will determine which child instance out of five needs to be injected here (as it depends upon some runtime parameter depending on which we have to create child instance). Please help me here how we create the configuration file i.e spring-config.xml for above scenario(i mean is there any way to configure such type of scenarios in spring)?