is new to CDI, I want to know the practical difference between the alternative and the Classifier.
In Link to Weld , she stated that:
4.3. Classifier Annotations
If we have more than one bean that implements a particular type of bean, the injection point can indicate exactly which bean should be entered using the classifier annotation.
but, explaining the Alternatives, it says:
4.7 Alternatives
Alternatives to beans, the implementation of which is specific to a specific client module or deployment scenario.
If I understood correctly, @Qualifier determines which implementations of the target bean are injected into Injection points.
on the other hand, @Alternative describes a client-specific wish during deployment regarding whether the alternative is up to the standard ("@default", I mean) bean to get an injection at the injection point.
Correctly?
java dependency-injection cdi
arthur
source share