This week's book giveaway is in the Testing forum. We're giving away four copies of The Way of the Web Tester: A Beginner's Guide to Automating Tests and have Jonathan Rasmusson on-line! See this thread for details.
Diff b/w dependency lookup and dependency injection while acquiring a stateful session bean instance
Arun Raja S.K
posted 3 years ago
I have been reading book "Pro JPA 2 Mastering the java persistence API ". The chapter 3 of this book gives an overview of EJB and dependency management.
At page number 61, it has been stated that " Dependency lookup is the preferred method for acquiring a stateful session bean instance for a
stateless client". The book also states that Dependency Injection is not good solution to access stateful session bean from stateless components.
Please explain me, how dependency injection differs from dependency lookup (normal context lookup) in case of accessing stateful session bean, though both types provide only reference to the concerned bean?