Popular Posts

Thursday, June 05, 2014

CDI - Contexts and Dependency Injection tutorial for Java EE

Contexts and Dependency Injection (CDI) is one of several Java EE 6 features that help to knit together the web tier and the transactional tier of the Java EE platform. 
CDI is a set of services that, used together, make it easy for developers to use enterprise beans along with JavaServer Faces technology in web applications. Designed for use with stateful objects, CDI also has many broader uses, allowing developers a great deal of flexibility to integrate various kinds of components in a loosely coupled but typesafe way.


CDI is the Java standard for dependency injection (DI) and interception (AOP).


The most fundamental services provided by CDI are as follows:
  • Contexts: The ability to bind the lifecycle and interactions of stateful components to well-defined but extensible lifecycle contexts
  • Dependency injection: The ability to inject components into an application in a typesafe way, including the ability to choose at deployment time which implementation of a particular interface to inject
In addition, CDI provides the following services:
  • Integration with the Expression Language (EL), which allows any component to be used directly within a JavaServer Faces page or a JavaServer Pages page
  • The ability to decorate injected components
  • The ability to associate interceptors with components using typesafe interceptor bindings
  • An event-notification model
A major theme of CDI is loose coupling. CDI does the following:
  • Decouples the server and the client by means of well-defined types and qualifiers, so that the server implementation may vary
  • Decouples the lifecycles of collaborating components by doing the following:
    • Making components contextual, with automatic lifecycle management
    • Allowing stateful components to interact like services, purely by message passing
  • Completely decouples message producers from consumers, by means of events
  • Decouples orthogonal concerns by means of Java EE interceptors

CDI tutorial

18 comments:

Chandrika Madapudi said...

I agree with your thoughts!!! As the demand of java programming application keeps on increasing, there is massive demand for java professionals in software development industries. Thus, taking training will assist students to be skilled java developers in leading MNCs. J2EE Training in Chennai | JAVA Training Institutes in Chennai

kovalan Jayamurugan said...

Thanks for your informative article. Android SDK allows you to create stunning mobile application loaded with more features and enhanced priority. With basis on Java coding language, you can create stunning mobile application with ease. Android Training Institutes in Chennai | Android Training in Chennai

murali karthik said...

Thanks for your informative post on selenium automation testing tool. Your article helped me a lot in understanding the future of automation testing tool and its career prospects. Selenium Training | Best Selenium training institute in Chennai

Giri Mani 2 said...

Great... Excellent sharing.. This is very helpful for beginers. Read that provide me more enthusiastic. This helps me get a more knowledge about this topic. Thanks for this.
Android Training in Chennai

for IT the said...

I have read your blog its very attractive and impressive. I like it your blog.

Java Training in Chennai Core Java Training in Chennai Core Java Training in Chennai

Java Online Training Java Online Training Core Java 8 Training in Chennai Core java 8 online training JavaEE Training in Chennai Java EE Training in Chennai

for IT the said...


Java Training Institutes Java Training Institutes Java EE Training in Chennai Java EE Training in Chennai Java Spring Hibernate Training Institutes in Chennai J2EE Training Institutes in Chennai J2EE Training Institutes in Chennai Core Java Training Institutes in Chennai Core Java Training Institutes in Chennai

for IT the said...

Java Online Training Java Online Training Java Online Training Java Online Training Java Online Training Java Online Training

Hibernate Online Training Hibernate Online Training Spring Online Training Spring Online Training Spring Batch Training Online Spring Batch Training Online

Evelin Harriet said...

Great information. I have got some important suggestions from it. I'm working in ERP Software Company in Chennai. | ERP Providers in Chennai.

Caroline Keerth said...


Amazing blog about the various informative information on the programming languages. PHP is one such programming language which is more easier to learn and has lot of scope in future which is provided by Php Training institute in Chennai

revathi said...

Your article about Web Designing is awesome. It helped me to understand the career prospects.
Web Designing Training Institute in Chennai | Web Designing Training Institute in Velachery.

Shivani Yuvanjalin said...

Really Nice Blog. Thank you for Sharing. We are the best erp software providers in chennai. For more details call +91 9677025199 or email us on info@bravetechnologies.in.
ERP Providers in Chennai

anitha a said...

Great information. I have got some important suggestions from it.
Web D School

Vamshi Krishna said...



very useful info, and Keep updating us...

Krishna Veni said...

Good and nice article, thanks for sharing your valuable information and time.. keep rocks..
Java Training institute in chennai | Java Training in velachery |Best Java Training in chennai

teja said...

Your blog is awesome.You have clearly explained about it. It's very useful for me to know about new things..Keep on blogging..Software Testing Training Institute in Chennai | Software Testing Training Institute in Velachery.

fawaz shaik said...

Great article..keep updating..
Embedded System Training in Chennai | Embedded System Course in Chennai | No.1 Embedded Training Institute in Chennai | Online Embedded Training in Chennai

chandhu said...

Thanks for sharing your informative article..keep updating such a useful Blog..
Linux Training Institute in Chennai | No.1 Linux Training Institute in Chennai | Online Training Institute in Chennai

ALINAAMEL said...


I would like to say thank you for the amazing details and concepts you are sharing in this.
Webseiten Gestaltung L├╝denscheid