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.
相关问题
- How to properly use Weld in JavaFX 2 application?
- Why am I getting a WELD-001303: No active contexts
- My web app works only with META-INF instead of WEB
- CDI Injecting services into JPA managed Entities
- Using JAX-RS (RESTEasy) with CDI (Weld) in Tomcat
相关文章
- Is it possible to destroy a CDI scope?
- Inject producer method that returns String CDI
- What's the default scope for a bean created by
- JPA lazy loading Collections in JSF view - better
- How do I upgrade an existing NetBeans Java EE 6 We
- Injecting RequestScoped CDI Bean into ApplicationS
- Deploy JSF composite components for shared use
- Using @Transactional with EJBs
I would have said the opposite ;) But both projects are excellent tools and come provided with different application servers. The key is that both follow the Java EE specification, and provide incredible power in programming flexibility and reuse.
Actually I use OpenWebBeans in a really productional Government project already, together with a full blown EE6 Web Profile environment. But I won't tell you where, so it cannot get slashdotted ;) (Btw, be prepared that most of the EE-6 parts, like e.g. EL-2.2 integration currently needs a lot of small patches and tweaks to get up running - but it really looks promising!)
In fact the Weld and OpenWebBeans communities are communicating with each other pretty often, so whenever we hit something not clearly lined out in the spec, we both try to discuss things out. And since the involved Caucho guys Ferg and Reza are both simply said java gods, I bet their implementation is really good as well ;)
As for OpenWebBeans: we are currently preparing a Milestone4 release which should get released next week. The openwebbeans-impl aka 'owb-core' has almost no dependencies at all! All 'heavier' dependencies are handled by drop-in plugins which get automatically picked up from the classpath if available. They cover certain parts of the spec when it comes to interacting with other EE parts. There is e.g plugins like openwebbeans-jsf, openwebbeans-jms, openwebbeans-resource (handling EE resources + JPA), etc
Btw: don't miss the wonderful easy way to write your own portable! CDI extensions.
To get a first idea, you might look at Seam3: anonsvn.jboss.org/repos/seam/modules/ and of course Apache MyFaces CODI: github.com/struberg/myfaces-ext-cdi (will get move to Apache MyFaces SVN soon)
LieGrue, strub
As long as the CDI specification is concerned, I hope there will not be any functional difference among RIs. Check this article: Understanding Java EE 6 and CDI
Currently they don't compare. I doubt any of them has been used in production, they're too fresh.
Quick overview of the protagonists:
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.