I have been learning Java EE for while and found Java EE provides two types of injection mechanisms
Please guide me to understand the difference between Resource Injection & Dependency Injection.
Java EE provides injection mechanisms that enable our objects to obtain the references to resources and other dependencies without having to instantiate them directly (explicitly with ‘new’ keyword). We simply declare the needed resources & other dependencies in our classes by drawing fields or methods with annotations that denotes the injection point to the compiler.
The container then provides the required instances at runtime. The advantage of Injection is that it simplifies our code and decouples it from the implementations of its dependencies.
Both the methods facilitates in achieving Inversion Of Control.