I have class structure that look like below:
class Base {}
class ChildA extends Base {}
class ChildB extends Base {}
I got this in my application code:
Base theObj = null;
if( str.equalsIgnoreCase("object_A") == true ) {
theObj = new ChildA();
} else {
theObj = new ChildB();
}
May I know how to configure the bean in Spring?