CHAPTER 12

image

Contexts and Dependency Injection

One of the most important features in Java EE is Contexts and Dependency Injection (CDI). CDI helps bind the web tier and the business logic or transactional tier of the Java EE platform together. CDI makes it easy to expose business objects for use within JSF web views so that developers can directly bind JSF view widgets to public JavaBean members and methods. It also provides facilities that make it possible to inject JavaBean classes and resources into other Java objects in a type-safe and efficient manner.

CDI is architected from two methodologies: contexts and dependency injection. Contexts

Get Java EE 7 Recipes: A Problem-Solution Approach now with the O’Reilly learning platform.

O’Reilly members experience live online training, plus books, videos, and digital content from nearly 200 publishers.