CDI and Seam 3 are the Future of Both the Seam Community and Red Hat.
In the second installment of our interview with Dan Allen, we find out what Java EE 6 means for the future of Seam.
Dan is an employee of JBoss by Red Hat working on the Seam and Weld projects, a member of the JSR-314 Expert Group (JSF 2.0), the author of Seam in Action and a frequent speaker at major industry conferences. His presentation at JavaOne 2009 earned him the JavaOne Rock Star award. But he’s best known by colleagues for his passion for free and open source software, particularly Linux and Java enterprise technologies. You can keep up with his discoveries by subscribing to his blog (http://mojavelinux.com) or following him on Twitter (http://twitter.com/mojavelinux).
In part two of our interview with Dan Allen, Jan Groth and Andreas Eigenmann ask him where Seam 3 fits into the Java EE 6 picture, and find out whether there are any plans for a ‘Seam in Action’ sequel……
Jan Groth: I’d like to switch to some more technical issues. Looking at the exciting new features of Java EE 6, like CDI, bean validation and JSF 2.0, a Seam developer will recognize many of these concepts from Seam 2. Has it been a strategy, to get these core ideas standardized?
Dan Allen: Absolutely. Jay Balunas, the RichFaces lead, had a great way of describing our strategy:
“Find a void. Fill the void. Standardize the fill.”
Red Hat is strong when the Java EE platform is strong. Our strategy does not depend on the platform remaining weak to justify the existence of our projects. It’s quite the opposite. If we make one of our own projects obsolete, or some part of it, that’s progress. Then we look for the next area to improve (there’s a perpetual queue.) If anything, we are the ones that really push this platform to reach its full potential. We invest in this cycle because JBoss has always been about choice: a low barrier to entry or exit. We want to be selected based on merit, expertise, leadership and a commitment to standards and openness. Not because you need our liferaft to use Java EE.
That’s only part of the story. In order to standardize these core ideas, the JCP has to be willing and able to allow it to happen. Not only do we bring ideas to the JCP to standardize, we also bring our principles of openness and transparency. We’ve worked hard, and continue to work, to make the JCP a community-driven organization. Admittedly, we have a long way to go.
Seam 2 affected all of the specs you mentioned above. The core of Seam evolved into CDI. Hibernate Validator and its integration with JSF went into Bean Validation and JSF 2.0 respectively. And about half of the JSF enhancements in Seam, and other recommendations in Seam (e.g, Facelets,) became standardized in JSF 2.0. And Java EE 6 in general adopted Seam’s minimal configuration and minimal layers spirit. It was a huge step forward and certainly Seam 2 developers will be right at home in the Java EE programming model.
Speaking of Seam and how it fits with Java EE 6…
Jan Groth: Some people are saying that Java EE 6 is “enough” and Seam 3 isn’t really needed any more. What would you say to those people?
Dan Allen: Seam’s mission statement remains the same: To provide a fully integrated development platform for building Internet applications based upon the Java EE environment.
Java EE 6 is a tremendous step forward for the platform. It’s the first revision that I can bring to a talk and, with a straight face, show the audience that you can build an application with it without any add-ons (i.e., liferafts.) In fact, it’s significantly better than the core of Seam 2, both in design and performance. There is a commitment to type-safety across Java EE 6 and that means stronger tooling, more robust code and less coding errors. And so much is calculated at application startup, that the runtime impact is close to zero.
The application servers are also so lightweight now that you should strongly reconsider your reasoning for using a Servlet container. As I like to say it, “Don’t settle for a Servlet container.” I say that because it’s like having to bring your own beer to the party. The environment has gaps. The introduction of the web profile closes the gap between the efficiency of a Servlet container and the full featured application servers, hitting the happy medium where developers can be productive and have all the key technologies that they need to create enterprise web applications.
However, if I told you that you could develop an entire application without a single third-party library, I’d be lying to you. Just like a house, you will need to furnish the platform in some places. Some of it just wasn’t standardized in time or addressed at all (*cough* security,) some of it still needed more thought and there are many things that simply cannot be standardized because of licensing (e.g., PDF creation) or it’s too specialized (BPM or rules engines). We don’t want Java EE to be a dumping ground for technologies. But it’s not totally spartan, either. You can think of it as a model home. You can move right in and start living, but eventually you will find needs that are unique and you’ll need to customize it. That’s where the Weld extensions and Seam 3 comes into play.
There’s going to be one very important difference this time around, though. Seam 3 is going to be modular and portable across Java EE application servers and servlet containers from the start. If you are a JSF user, you can think of Seam 3 modules as more like UI component libraries in how they fit into the platform. This portability will be ensured through three guarantors:
1. Seam 3 is primarily built on the CDI portable extension SPI, insulated from handling low-level concerns that run a high risk of breaking portability.
2. One of the principal requirements of Seam 3 modules is portability.
3. The Arquillian in-container test framework allows modules to be continuously tested against an array of application servers.
Is Java EE 6 a solid platform? Yes. Will you still need extensions? Yes. And CDI was designed specifically to be able to root and foster such an ecosystem. You can even write your own extensions, which really wasn’t possible with Seam 2. Now we just need a plug-in site
Jan Groth: Say I’m a software architect looking for an enterprise framework for my next web project. I heard a lot of good things about Seam, but I feel a bit torn between at least three options: Use Seam 2.2 on Java EE 5, use CDI / Weld on Java EE 6, or wait for Seam 3. Is there any advice you could give me?
Dan Allen: That’s always a tough question because you don’t want to leave anyone out. I certainly wouldn’t have written a book about Seam 2 if I didn’t think it was something pretty compelling and productive. If you are preparing an application for immediate deployment to production, you are comfortable with Seam 2 or you want to be able to use the Red Hat Enterprise Application Platform (EAP), then you should strongly consider Seam 2. You might also like Seam 2 because its rules for injection and state management are a lot less strict than CDI. But know that CDI and Seam 3 are the future of both the Seam community and Red Hat. So even if you are using Seam 2, you should be spending time researching and learning Java EE 6 and Seam 3. If you’re to make the move to Java EE 6, which I highly recommend for early and more flexible adopters, you don’t have to wait for Seam 3. It’s happening now. There are alpha releases of several modules available and many more will be ready by summertime. If something is missing, it’s really not that difficult to write a CDI extension to fill the void in the meantime. Heck, it might even get you involved in Seam 3 development.
Jan Groth: As an interested developer, is there a chance to contribute to Seam? What would be a good starting point?
Dan Allen: Absolutely. The best place you can go is the Seam 3 website. We’ve spent a lot of time laying out a very clear map of all Aspects of Seam 3, from using it, to contributing to it. I recommend that you read up on the ways to get involved and find what works best for you. If something is unclear, please let us know either on the forums or the mailinglist. We are eager to make the instructions as lucid as possible. In fact, it sounds like something I need to blog about.
To post on the forums, you first need to create an account. If you haven’t done so already, we also encourage you to create an account at JBoss so that you can establish a profile, connect with other developers and post to related projects and use JIRA. If you want to get coding right away, you can either browse JIRA for a feature request that interests you or browse the modules page to see if there is a module you either want to join or help lead.
As I mentioned before, we don’t just want Seam to be a framework you get for free. That’s not Open Source. We want it to be open and collaborative. We want you to feel ownership, however you may fit in. There are no closed doors and there are no dumb ideas, as long as they are backed by a real need. (However, people may not always like your ideas, so come ready to defend them when necessary.) We not only aim to be the best framework for developing internet applications in Java, but also the most fun.
Jan Groth: Dan, you are the author of ‘Seam in Action,’ one of the most highly regarded books on Seam – are there any concrete plans for a sequel?
Dan Allen: Thanks. I wrote the book because I had been told I had a very unique and in-depth way of explaining the topic and I knew that if I could tell my story, it would benefit a lot of developers. I’m grateful to hear that it did. Even for people who haven’t adopted Seam, I think the book shed light on problems with the platform that needed resolving.
Are there concrete plans for writing a sequel? At this point, no, the plans are not concrete. For one, I still think it’s too early. We are only just beginning to find out what can be done with CDI extensions. And I think a book that doesn’t cover the extensions isn’t going to be a complete handbook for developers like ‘Seam in Action’ has been. I also have to consider the impact it will have on the project and the community. I am really enjoying getting more involved with the community and, with Pete, guiding the module leads. I can’t imagine how I would manage to fit writing a book in between all of my initiatives. I think by the beginning of next year, we will have lots of extensions out, things will be humming along, and then the world may be ready for a sequel. I’m also strongly considering having a co-author, not just because it’s too difficult to do alone, but because I think people will benefit from at least one other perspective (and I will keep my marriage.) Whenever the book is written, people will be very happy to know that there will be a much stronger emphasis on testing, now that we have Arquillian for writing proper and flexible in-container tests. And yes, since Seam 3 is built with Maven 2, and we have official Maven archetypes for CDI and Java EE projects, the examples will be built with Maven 2 (and seam-gen will no longer be a big scary Ant script.)
I’m very excited about all the innovation that is taking place in the JBoss Community right now and I encourage you to become a part of it. You never know where it will lead, but I can guarantee you it will open doors for you.
Jan Groth: Thank you very much for your time!