Basic Injection / Qualifiers, Scope

About Alvin Reyes

This is a continuation of the DI/CDI Basics tackled last week  - in this post, I’ll be discussing Basic Injection, Qualifiers and Scope.

In our last topic, there we’re a great deal of information regarding the concepts of DI/CDI, we also discussed how these beans or class loaded using the annotations  -that makes up the composition of the object and created samples on how can we declare them programmatically. In this post, we will tackle more on the injection part, e.i how to acquire a certain resource and inject them on another resource for usage.

So how to inject a bean in the first place?
 

Basic Injection

How do you inject a Bean?

  • Use @Inject <Java-Type> <variable> for field injection

Source : http://www.javacodegeeks.com/2013/08/basic-injection-qualifiers-scope.html

Back to Top