# The Java EE 7 Tutorial

# 4.3 The Main Differences between Resource Injection and Dependency Injection

Table 4-1 lists the main differences between resource injection and dependency injection.

Table 4-1 Differences between Resource Injection and Dependency Injection

Injection Mechanism | Can Inject JNDI Resources Directly | Can Inject Regular Classes Directly | Resolves By | Typesafe
--- | --- | --- | --- | ---
Resource Injection | Yes | No | Resource name | No
Dependency Injection | No | Yes | Type | Yes