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.
Clarification needed about Dependency Injection in JavaEE
posted 7 months ago
I'm trying to get a clear high-level understanding of classification/architecture/semantic/whatever about the whole dependency injection subsystem in JavaEE, and I'm a bit confused.
I've read many articles, specifications and (portions of) books, and this is what I got:
A - Inversion of Control is a programming practice B - Dependency injection is a pattern that follows IoC (service locator is another example)
C - CDI is a Java service that implements DI with some additional features like context scopes etc.
D - Resource injection via @Resource annotation is a (old fashioned? just different?) way to inject resources registered in the JNDI namespace
My questions are:
1 - is any of the previous points wrong in any way?
2 - in this "picture", where do @EBJ, @PersistenceUnit, @PersistenceContext... injections collocate themselves? I mean, these are some injection mechanism but they're not resource injection nor CDI... what am I missing?