Differences between Java EE 6 CDI Implementations

user265863 picture user265863 · Feb 16, 2010 · Viewed 11.2k times · Source

I've looked at JBoss' Weld Reference Implementation of JSR-299 Contexts and Dependency Injection, and I wanted to know how others CDI implementations compare to each other. Specifically, I know about Weld, Resin CanDI (by Caucho), and Apache OpenWebBeans.

Answer

Pascal Thivent picture Pascal Thivent · Feb 16, 2010

Quick overview of the protagonists:

  • Weld is the RI (there is only one RI), version 1.0 is out, it is built into GlassFish v3 and the upcoming JBoss AS EE 6 but can also be used with other containers (with some limitations).
  • OpenWebBeans is still under development, version 1.0.0 is planned for end of April 2010.
  • Caucho CanDI seems to be tied to Resin (I may be wrong here but I couldn't find any clear proof of the contrary on their website, which is bad anyway).

So, if I had to pick one implementation at the time of writing this, I would pick the RI (i.e. Weld) because it's ready and can be used "standalone" (ready doesn't mean it has been widely used).

If you're looking for some performance comparison (what else would you like to compare?), I don't think you will find such a benchmark for now.

In any case, if you want to use CDI, just do it.