type=page
status=published
title=The Main Differences between Resource Injection and Dependency Injection
next=packaging.html
prev=injection002.html
~~~~~~
= The Main Differences between Resource Injection and Dependency Injection


[[BABHFECJ]]

[[the-main-differences-between-resource-injection-and-dependency-injection]]
The Main Differences between Resource Injection and Dependency Injection
------------------------------------------------------------------------

link:#BABCEJEE[Table 4-1] lists the main differences between resource
injection and dependency injection.

[[sthref19]][[BABCEJEE]]

*Table 4-1 Differences between Resource Injection and Dependency
Injection*

[width="99%",cols="25%,20%,20%,20%,15%"]
|=======================================================================
|*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
|=======================================================================
