Monday, July 27, 2009

Dependency Injection (DI) and JNDI

EJB3 in action
Chapter 2.1.2 - Introducing dependency injection In a sense, injection is lookup reversed. As you can see, in the manual JNDI lookup model, the bean explicitly retrieves the resources and components it needs. As a result, component and resource names are hard-coded in the bean. With DI, on the other hand, the container reads target bean configuration, figures out what beans and resources the target bean needs, and injects them into the bean at runtime.

Inversion of Control Containers and the Dependency Injection pattern

No comments:

Post a Comment