Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Dependency Injection works only in managed classes. What does this mean

 
ramakrishna kulkarni
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All

Dependency Injection is not supported in non managed clasess in EJB and web teir.

My doubt here is what they mean my mangaged classes

Thanks in advance
 
Prasad Shindikar
Ranch Hand
Posts: 114
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Managed classes mean, the classes that are managed by the container. These can be Servlets, EJBs, JSF Backing beans etc. However, these cannot be Helper Classes that can be custom defined to provide for some specific functionality.

Since DI happens courtesy of the container, helper classes cannot access DI.

Hope this helps.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic