Monday, 9 September 2013

Spring 3 Dynamically choosing bean class

Spring 3 Dynamically choosing bean class

So on an app I'm building it would be convenient to be able to read a
value from configuration, and then based off of the value read, choose
between two implementations of an interface and then build a bean of that
object.
I have the config file setup (using util:properties), and other java code
is accessing it just fine, but I'm uncertain about how to reference it in
my application context xml file, and how code this conditional logic. Or
am I going about this incorrectly?

No comments:

Post a Comment