© Jan Beernink and Arjan Tijms 2019
J. Beernink, A. TijmsPro CDI 2 in Java EE 8https://doi.org/10.1007/978-1-4842-4363-3_3

3. Identifying Beans

Jan Beernink1  and Arjan Tijms2
(1)
Dublin, Ireland
(2)
Amsterdam, Noord-Holland, The Netherlands
 

One of the core responsibilities of CDI is to provide dependencies, which are beans in CDI. As you learned in the previous chapter, such beans can be obtained in various ways, namely, by having them injected in some way or by programmatic lookups. An important aspect of obtaining beans is that you need a way to specify which bean you want. In other words, you need to be able to identify beans. This raises the following questions: how are beans made identifiable, and how do you make sure someone can refer to your ...

Get Pro CDI 2 in Java EE 8: An In-Depth Guide to Context and Dependency Injection now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.