January 2018
Intermediate to advanced
350 pages
9h 7m
English
If you take a look at our quote manager application, you may have noticed that QuoteService was injected in QuoteResource or DirectQuoteSocket. We are exactly in the IoC area of the CDI container. Here, the algorithm globally looks as follows (in pseudo-code):
Object createInstance() { Object[] constructorArguments = createConstructorArguments(); <1> Object instance = createNewInstance(constructorArguments); <2> for each injected field of (instance) { <3> field.inject(instance); } return prepare(instance); <4>}
To fulfill its role, the CDI will need to instantiate an instance and initialize it. To do so, it proceeds with the following steps which leads to provide you a ready to use instance:
Read now
Unlock full access