This morning I uploaded a GA release of Seam 1.1. For those who've been following the development of Seam 1.1, there is not much new in this compared to the two CR releases. The only significant improvements compared to CR2 are that we now have the Hibernate and JPA example applications running out of the box on WebLogic (as well as JBoss, GlassFish and Tomcat), a number of enhancements to seam-gen, and a nice built-in datepicker control.
Download it here .
But for those who've been sleeping on Seam, here's a quick rundown on what's new in 1.1. (If you've never heard of Seam, and are wondering why you care, go here first.)
More importantly, we've created a brand new concurrency management architecture for Seam. AJAX fundamentally changes the interaction model of the web. If you try to take a traditional stateless architecture, designed for use with few, synchronous, coarse-grained requests, and re-use it in an AJAX environment where many, asynchronous (and therefore concurrent), fine-grained requests are the order of the day, you're virtually guaranteed to kill your database! AJAX makes server-side (conversational) state management a requirement, not a nicety. Amazingly, Seam is the only architecture in existence today which offers a strong model for conversation state. But the possibility of concurrent access to server-side conversation state opens up a whole raft of threadsafety issues which are not addressed by the servlet specification. Seam 1.1 solves these problems in a robust way.
It's very important to make clear that Seam is not, primarily, a Rails/Grails/Trails style framework for simplifying the development of basic data-oriented applications. Seam certainly does very much simplify the programming model of typical J2EE or Spring+Hibernate application architectures, but you won't really fully appreciate Seam until you start to come to terms with the stateful component model, conversations, conversation-scoped persistence contexts, pageflow and business process management. However, there is no reason on earth why the existence of this sophisticated functionality can't live comfortably beside facilities for simplifying basic data access. So Seam 1.1 introduces an Application Framework and a command line tool. These are surprisingly simple since they are layered over Seam's existing programming model, and are able to leverage all the power and simplicity of Seam.
The Seam Application Framework will eventually grow a lot bigger than it is now, and might eventually end up being packaged seperately from the Seam core. For now it provides Query and Home objects for both JPA and Hibernate3. These are classes that you can re-use either by extension or configuration. If you like, you can think of them as filling a similar role to DAO in a more traditional Java web application architecture. The biggest difference is that in Seam it is perfectly reasonable to bind Query and Home objects directly to the view (with loose coupling courtesy of the EL) whereas more traditional architectures force you to access the DAO via some kind of Action class. Of course, you can still inject a Query or Home into any Seam component and call it programmatically if that is what you prefer. As always, Seam lets you layer your code, but does not force any particular layering upon you.
The commandline tool makes it super-easy to get started with Seam. A few keystrokes, and you'll have a full Eclipse project structure (NetBeans is also supported) that automagically re-deploys itself to a JBoss exploded directory when you edit code. A few more keystrokes, and we've got a page with a simple action. A few more, and we've reverse engineered a whole Seam application (based on the Application Framework) from the database. The reverse engineering tool is, of course, built on top of Hibernate Tools. We intend to integrate the functionality of the commandline tool into a future release of JBoss IDE.
This work also involved improving Seam's extensions to JSF that allow the easy creation of applications with bookmarkable pages.
Previously, Seam could be deployed on a Java EE 5 environment like JBoss or GlassFish, or on standalone Tomcat with the help of JBoss Microcontainer or JBoss Embeddable EJB3. We have heard loud complaints from a number of potential users who want to use Seam but are stuck on J2EE application servers like WebLogic or WebSphere. Seam 1.1 is compatible with J2EE (you can use either JPA or Hibernate for persistence) and comes with some examples that deploy out of the box on WebLogic (we'll get up to WebSphere next release).
This change meant that we needed to beef up Seam's support for plain JavaBean components, since in a J2EE environment people won't be able to use stateful session beans. A lot of the less visible work in Seam 1.1 involved building an efficient clustering architecture of stateful JavaBean components.
Seam-managed persistence contexts are one of the coolest things in Seam. In fact, one of the main reasons we decided to create Seam in the first place was our frustration at the all the problems Hibernate users experienced with LazyInitializationExceptions when using Hibernate with stateless session beans or Spring. Seam persistence context management got two major enhancements in this release. First, there is a bunch of extremely complex code (totally invisible to the user) to allow extremely efficient clustering of extended persistence contexts - even more efficient than what the EJB container is allowed to do with container-managed persistence contexts. Second, we introduced support for atomic persistence contexts. An atomic persistence context lets you make changes to managed objects across many requests in the same conversation, but have those changes be made persistent only at the end of the conversation (or some other well-defined point), instead of at the end of each request. This is a feature that JBoss, Sun and Sybase tried unsuccessfully to standardize into the EJB3 specification. If you want to use this feature, you'll need to use Hibernate as the JPA provider.
Seam 1.1 layers support for asynchronous method invocation over the EJB3 timer service. This is a
lightweight way to achieve asynchronicity in cases where JMS is overkill (don't worry, Seam also makes sending and receiving JMS messages a breeze, but that is not new).
Seam 1.1 introduces some additions to Seam's JSF tag library, the most notable being a control for page fragment caching (similar to OSCache, which does not work with JSF), a control for adding fancy
decorations to fields when validation fails, and a nice datepicker.
We've enhanced Seam's XML configuration facility, allowing more flexible packaging of the XML, and the use of namespaced schemas along with other improvements.