Bio
Gavin King is a Distinguished Engineer at Red Hat. He's the creator of Hibernate, a popular persistence solution for Java and of the Ceylon programming language. He contributed to the Java Community Process as JBoss and then Red Hat representative for the EJB and JPA specifications and as spec lead and author of the CDI specification. He's currently a major contributor to the design of Jakarta Data and Jakarta Persistence. He lives in Barcelona with his wife and three daughters. His active interests include theoretical physics and quantum technologies.
Tags
Authors
You should upgrade to Java EE 6
With the release of Java EE 6, I've seen a number of recurring, but rather curious, arguments against upgrading to the new platform. These are usually deployed by folks who are using a homegrown
stack consisting of a servlet engine like Tomcat or Jetty together with a number of open source frameworks like Hibernate and Spring.
CDI portable extensions in the wild
Since the release of Weld and Java EE 6, there's been a heap of activity in the Weld user forum, and especially a lot of questions about problems related to framework development. You can do some kinds of generic programming in CDI just using managed beans, producer methods and InjectionPoint. But if you want to get serious, you're eventually going to have to embrace the portable extension SPI. Here's a couple of examples of how people are using this SPI.
Article on Ajax and JSF
In case you missed it, Jay and Dan published an article about Ajax and JSF2 on DZone.
JSF 2 and CDI with Netbeans and Glassfish
Andy Gibson has written a nice tutorial to help you get started with JSF 2 and CDI using Netbeans and Glassfish. It's great to see that both Netbeans and Intellij 9 already have excellent support for Java EE 6.
Java EE 6 Final Release
As I'm sure you've all seen, Java EE 6 has gone final. You can now download the Final Release of the Contexts and Dependency Injection, Bean Validation, Java Persistence API 2 and Java Servlet 3 specifications from jcp.org, and read the linked javadoc for the entire platform. It's also a good chance to check out the Java API for RESTful Web Services specification, which now includes CDI integration, if you havn't already.
The usual suspects
On CDI interceptor bindings
Matt Corey has blogged about CDI interceptor bindings, showing a simple example of how you can implement your own @RequiredTx annotation. He also lightly criticizes the use of beans.xml for interceptor enablement. (This was also discussed in the Weld forum.) I really think we have the design just right here, and I'll explain why. But first let me remember why CDI interceptor bindings are much better than the @Interceptors annotation from EJB 3.0.
More on CDI interceptor bindings
Why is beans.xml required in CDI?
I've seen a couple of folks wondering why CDI requires a beans.xml file in every bean archive. If there's no alternatives, interceptors, or decorators to declare, why do you need to have the empty file?