Running your first CDI 2.0 code

Context and Dependency Injection (CDI) is certainly one of the most important APIs for the Java EE platform. In version 2.0, it also works with Java SE.

Nowadays, CDI has an impact on many other APIs in the Java EE platform. As said in an interview for Java EE 8 – The Next Frontier project:

"If there was CDI by the time we created JSF, it would be made completely different." – Ed Burns, JSF Spec Lead

There is a lot of new features in CDI 2.0. This recipe will cover Observer Ordering to give you a quick start.

Get Java EE 8 Cookbook 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.