Say I need to rely on several implementations of a Spring bean. I have one AccountService
interface and two implementations: DefaultAccountServiceImpl
and SpecializedAccountServiceImpl
.
How is this possible (injecting one or the other implementation) in Spring?
Which implementation will the following injection use?
@Autowired private AccountService accountService;