Win a copy of Practical SVG this week in the HTML/CSS/JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Dependency Injection Concept

 
Nghiem Nguyen
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,
Can anyone tell me about what is Dependency Injection in EJB 3.0?
Thanks a lot.
Rock.
 
Pradeep bhatt
Ranch Hand
Posts: 8933
Firefox Browser Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Depenedency injection means that someone else(the container) gives the dependent objects to your code. For example your class is dependent on DataSource object and you specify this dependency in your code so that the EJB container gives you the requested DataSource. No lookup code to write.
 
ak pillai
author
Ranch Hand
Posts: 288
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Inversion of control or dependency injection is a term used to resolve component dependencies by injecting an instantiated component to satisfy dependency as opposed to explicitly requesting a component. So components will not be explicitly requested but components are provided as needed with the help of an Inversion of controller containers. This is analogous to the Hollywood principal where the servicing components say to the requesting client code �don�t call us, we�ll call you�. Hence it is called inversion of control.
 
Mishra Anshu
Ranch Hand
Posts: 224
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You may want to read it :-
Dependency Of Injection

This has become famous after the "Spring" (which uses it) became famous.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!