File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes EJB and Other Java EE Technologies and the fly likes JNDI and DI Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Java » EJB and Other Java EE Technologies
Reply Bookmark "JNDI and DI" Watch "JNDI and DI" New topic
Author

JNDI and DI

vShyam Sundar
Ranch Hand

Joined: Oct 13, 2010
Posts: 38
Hi,
Could any one illustrate me the difference between JNDI and Dependency Injection. What was the advantage of using Dependency Injection over JNDI.


And also How does a client calling a stateless session bean through JNDI differs from client calling the static classes.


Thanks,
Shyam.
Jaikiran Pai
Saloon Keeper

Joined: Jul 20, 2005
Posts: 6720

vShyam Sundar wrote:
Could any one illustrate me the difference between JNDI and Dependency Injection. What was the advantage of using Dependency Injection over JNDI.

JNDI and dependency injection are two different things. Agreed that in Java EE most of the times the injected values come from JNDI, but that's not the only place where the injected values need to come from. Dependency injection is independent of JNDI. This journal article by one of the JavaRanch Sheriffs explains dependency injection well.


[My Blog] [JavaRanch Journal]
vShyam Sundar
Ranch Hand

Joined: Oct 13, 2010
Posts: 38
Thanks for your post.
 
 
subject: JNDI and DI
 
Threads others viewed
Dependency INjection through Annotations
how to use local & remote intefaces in ejb3
Unable to understand exception
When did the Stateful Sessionbean created?
EJB annotations at the client side
IntelliJ Java IDE