Following quickly on the heels of the Java EE 6 and CDI spec approvals, the application server team at JBoss, led by Jason Greene, recently unveiled the JBoss AS 6 Milestone 1 release which includes support for three key EE6 features:
- JSF 2, which includes major improvements over JSF1 such as AJAX support and integration with Bean Validation.
- Bean Validation (JSR-303), which provides centralized validation of model objects accross all tiers (presentation, data, etc).
- CDI [Weld RI] (JSR-299), which offers an innovative and feature rich context management and dependency injection framework for EE applications.
The latest JBoss AS 6 M1 release also includes support for Mod_cluster, a load balancing solution that integrates with the Apache Web server, and support for EmbeddedAS, a prototype for a new API that launches, configures and deploys against an in-VM JBoss AS instance. JBoss AS lead Jason Greene discusses some of these new features, in this exclusive interview with DZone.
JBoss AS 6 M1 can be downloaded here
The complete transcript of the interview has been provided below.
DZone: Jason, can you tell us a little bit about some of the recent work here that you have been doing at Red Hat?
Jason Greene: Sure. Most recently I represented Red Hat on the EE6 specification, where I focused primarily on ensuring that the web profile portion of the spec actually addressed the areas that are important for modern web application development. I also have been involved with the enterprise application platform from 5.0, which is the first enterprise platform we have produced off of the AS5 architecture. And, of course, as project lead I'm responsible for delivering frequent AS community releases and have done so with the 5.1 series, and most recently with the AS6 Milestone 1.0.
DZone: Jason, with the approval of the Java EE 6 specification recently, there were several specifications backed in particular by Red Hat, that were also approved. Can you tell us a little bit about the significance of these specs?
Jason: The two major Red Hat‑led specifications that were included in Java EE6 were the CDI specification for context and dependency injection, and the bean validation specification. Also EE 6 included a number of other improvements that were significant, like the introduction of the web profile, which will great benefit web application development.
There have also been some improvements around extensibility, where, up to this point we've never technically been allowed to release something that is just EJB3, or just, say, the servlet spec. Now, actually any certified vendor can release individual components like that.
DZone: You mentioned context and dependency injection. How does that change the way we develop and deploy applications?
Jason: The context and dependency injection framework completely revolutionizes the way EE application development is done. Up until this point, the EE specification primarily has been sort of a coalescence of specifications that address specific problem areas. For example, the JSF specification targets the web presentation layer, and the JPA specification targets the data tier. However when you build an application you don't use either one of those by themselves usually. Usually you use them together and so you end up writing quite a bit of glue code between the layers.
What the context and dependency injection framework does, is it just simplifies that process by which those layers can be combined together. To use a specific example, you can actually take an EJB stateful session bean and have that be directly referenced in your JSF pages as a stateful component, or a stateful managed bean.
DZone: The other specification you mentioned was bean validation. How does bean validation change the way we validate data in our applications?
Jason: Bean validation solves a problem that developers have been facing for quite a while, although maybe many haven't realized how big of a problem it is. And that is that as you write these big major web applications, you end up repeating your validation logic in different layers, multiple times. And this leads to consistency problems, such that one layer may validate too less, or too much, or there could be a conflict where two are validating two different things.
So instead of relying on sort of this cut and paste approach, with bean validation you can express your logic in the actual place that it belongs, which is in the data objects themselves. So in a model entity bean that you would use in JPA you can declare the rules for, say, what's a valid zip code, or what's not a valid zip code. And then you know that as each EE layer processes that object that the validation rules will be enforced.
So it's all in one place, it's much easier to use and much easier to enforce. Not only does it make things better, it should also reduce the amount of errors that you have in applications. For many of the developers that I have talked to validation seems to be a common area where things go wrong.
DZone: So the theme seems to be again, eliminate the glue code, reduce redundant validation code, and ultimately we now have a new simplified programming model with CDI and bean validation. Is Weld is now the reference implementation for CDI?
Jason: Yes that is correct. Weld is the reference limitation for the CDI specification, which you can download right now. And it's actually included in the 6.0 Milestone one release. All of these technologies, when used together, what they are really ultimately addressing is unifying the development model. You essentially now have one sort of simplified, elegant API that you can use to develop your software, as opposed to the sort of disparate API's where you're doing a lot of work to try and make them work together. That is really the ultimate theme in all of this.
And also I will mention that the web profile takes it a little bit further, in that it only includes these technologies which you would view essential for accomplishing these things. You don't have to worry about pulling in a number of frameworks that are not essential to a web application like enterprise integration services, or necessarily JMS that you need.
DZone: So CDI and bean validation will be in the Java EE 6 web profile?
Jason: Yes that's correct. Web profile includes all those technologies. It also includes the Servlet three specification and a number of other JSF and JSP related enhancements. Another aspect that I haven't really mentioned a lot about is called managed beans. What it's all getting to is any time that you have a component in the EE landscape; everything will be services that extend upon this particular component, so in the CDI case and the Bean Foundation case, these are all services that are provided towards a common EE component.
DZone: Switching gears here a bit, Jason, your group, the application server group at Red Hat recently changed its versioning approach from using betas and alphas to milestones. What was the reasoning behind that?
Jason: So the thought process we had, we really wanted to look at the way our versioning scheme was and if it applied to our new model, which is the new model being a separate community release structure and a separate enterprise release structure. So everything that I'm referring to up to this point has been focused on the AS6 community release, all of which will eventually end up in an EAP release of some sort. We found that these two models really have different audiences; the enterprise audience is more focused on things like longer release cycles, backwards compatibility, extra stability and integration with other third‑party products.
The community audience on the other hand is really after innovation and they're after features as fast as they can get their hands on them. So by changing the release structure we wanted to try to fulfill those goals.
So by having milestones, what we're able to do is narrow those requirements down to a specific set of features that we deliver rapidly, so a developer who is interested in using the community AS6 release can start with Milestone one and then as we add capabilities, easily update to the next milestone and include those new features in their application.
This is quite a bit different than alphas and betas where with alphas and betas, you're kind of viewing it as a full complete piece on its own. And the alphas and betas usually are not fully featured complete. They usually start to become more polished towards the end with the final releases.
So with this milestone philosophy, we're going to focus more on delivering releases rapidly and delivering the small feature blocks when it's useful for developers.
DZone: Have you gotten positive feedback for the Milestone one release for AS6?
Jason: Yes. We've actually gotten great feedback from it, and that was the number one thing that I was hearing from developers out there as well. "Can we get our hands on this? Can we use it now?" I think that a lot of times, we tend to think, well, everything needs to be fully completed before the developers want to use it. That's not really the case in the community, from what I see. They have a particular problem and if there's a technology like bean validation then they want to start using that now. I think it's been a great result so far.
DZone: Jason, what are some of the new spec features in the Milestone one release?
Jason: So the two major EE 6 features that we included in Milestone one happen to be the two features that we feel are the most important in the EE 6 specification. So we've included CDI in the form of Weld, and also bean validation which is a community project wise called Hibernate Validator. Hibernate Validator actually predates bean validation. So just to eliminate any possible confusion there; the new version of Hibernate Validator complies with the specification. That's what's included in EE 6 Milestone 1.
DZone: What are some non‑EE 6 features that are included in the Milestone one release?
Jason: So one major feature that we have mod_cluster, which for those out there using AS in a high availability environment will appreciate this feature. Really, what this is, is is an evolution over mod_jk, which is our existing method for load balancing web requests. For those who aren't familiar with mod_jk, let's say that you have, say, an Apache web server which sprays requests across multiple nodes in a cluster and this is typically done in a round‑robin type fashion.
What mod_cluster does is it changes that to where there's intelligence involved in the actual application server level. So we can have various policies such that, a particular server, if it has too high load will receive less requests than another server which has low load.
You can also enhance these policies to provide your own metrics or ways to weigh different servers. This feature, by the way, was also included in our EAP 5.0 enterprise release.
DZone: Can you give us a sneak preview of some of the upcoming features you're working on for the upcoming release?
Jason: Right. So with the next milestone, the two major areas that we're going to focus on spec‑wise is Servlet three and JPA 2, which both we want to see being completed. Other areas will be addressed as well. We're probably going to be looking at integrating remoting a new framework we have for improving invocation time. And it really is not final at this point, so it's open to the community to decide what else we can fit in the time frame. So if there are folks that are interested in actually participating in this process, they can subscribe to the JBoss development mailing list and follow the discussion there and contribute to it as to what they would like to see in the Milestone two release, but primarily focusing on those two EE 6 features.
DZone: Where can people go to download the current milestone release?
Jason: You can go to the JBoss.org community website, and click on the JBoss AS project page. There you'll see the download link that'll bring you right to all the different releases we've done for AS6.
DZone: Jason, on behalf of the community, thank you very much for your time today, and we look forward to speaking to you real soon.
Jason: Thank you very much.