Hi all,
I'm studying a tutorial which covers CDI qualifier. In such a case where I have 2 ItemDao and 1 ItemProcessor:
ItemDao Interface | | ItemDao1 ItemDao2 @Demo ItemProcessor @Inject @Demo
What's the advantage of using CDI qualifiers over standard Java Polymorphism ?
For example I could simply have (without Qualifiers)
public class ItemProcessor { ItemDao dao; if (condition1) dao=new ItemDao1(); if (condition2) dao = new ItemDao2(); }
So the main benefit of using qualifiers if to push the polymorphism outside of the business class (ItemProcessor)? Forgive me if the question is too basic!
Thanks
Mylos
Forgive me the typo: it was meant: So the main benefit of using qualifiers is to push the polymorphism outside of the business class (ItemProcessor)?