I have an interface and several implementation classes, about 10, of this interface.
I have a naming convention, like prefix + name + suffix , so at runtime I can add @Autowired private Map<String, MyInterface> myImplementations; and then access the implementation class using the myImplementations.get() method.
Is there a better way to access these implementations? I only know which imp. I need it at runtime, changes depend on the message I received.
source share