Java interface with multiple implementation classes having same signature
My question is regarding java and spring. I have a controller class, service classes and DAO classes. For both my controller and service layers I have an interface and its implementations. Suppose I have one interface in my DAO layer which has two implementations and I call my DAO functions from my service implementation class. In my service implementation class I Autowire the DAO interface to make the DAO function calls.
So when I make my calls from service implementation via DAO interface how do I make sure that I am calling the desired DAO implemntation out of the two implemntations I have?