Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

JNDI and DI  RSS feed

 
vShyam Sundar
Ranch Hand
Posts: 60
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Sheriff
Posts: 10447
227
IntelliJ IDE Ubuntu
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.

 
vShyam Sundar
Ranch Hand
Posts: 60
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for your post.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!