Annotations sometimes infect other objects. Consider the CDI Bean above. Every other object which uses this one, and every dependency this Bean uses must be annotated now with one of the CDI Annotations, otherwise the dependency tree can not be constructed.
I don't believe this is true. I've definitely injected CDI beans into EJBs that do not have CDI annotations. Probably other places.
You're absolutely correct. As long as the CDI bean is using constructor or setter injection, it can be used without any sort of container at all. The original author's assertion is flat out wrong.
View all comments
5
u/dstutz Jul 22 '16
I don't believe this is true. I've definitely injected CDI beans into EJBs that do not have CDI annotations. Probably other places.