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;
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…