2

I have a basic know-how understanding about EJB3 and CDI but i want to dig deeper and understand how this 2 DI implementations actual work.

stackoverflow.com/questions/4684112/how-do-cdi-and-ejb-compare-interact

I have studied them but i fail to find what entity deals with the actual injection of the objects in the annotated variables and and by who is called.

Any help in this is welcomed. Thank you!

Community
  • 1
  • 1
aurelius
  • 3,946
  • 7
  • 40
  • 73
  • 1
    When studying this stuff be aware that CDI replaces and standardizes legacy built-in ways to do injections; but those legacy injection mechanisms still exist. There isn't really a comparison between the EJB3 and CDI standards, only to how the naming and injection of such objects works. – Gimby Jan 05 '15 at 10:21
  • ok, so the "entity" that deals with injection is different, depending on the web server on which the web application is deployed? – aurelius Jan 05 '15 at 10:26

1 Answers1

3

The "entity" that handles the injection is any injection framework, such as the reference implementation Weld for CDI or any particular EJB framework included in an application server.

The calling is done by the client code, which will reference the framework's proxies and enable the framework to perform actions.

Kayaman
  • 72,141
  • 5
  • 83
  • 121
  • so, this means that there are different entities, depending on the application server on which the application is deployed? but as I know CDI is the Java framework that implements DI so the which class/entity actually injects the instance into the variable (this is my actual question)? – aurelius Jan 05 '15 at 10:29
  • 1
    CDI is a specification. See http://stackoverflow.com/questions/2270379/differences-between-java-ee-6-cdi-implementations Although it's outdated, you can still see that there are different implementations, which may have differently named classes doing the same thing. – Kayaman Jan 05 '15 at 11:19