Help

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.)

AJAX

Seam has featured (DWR-like) AJAX component remoting for a while now and this functionality is popular and useful. But realistically most Java developers would prefer to be able to get functionality like partial page refresh, interactive server-side validation, server-side suggest, etc, without needing to futz with JavaScript at all. This is where ICEfaces and Ajax4JSF come in. These are the leading AJAX component libraries for JSF, and they are the easiest way to build a rich client using simple, declarative JSF templates. We've been working with the ICEfaces and Ajax4JSF teams to make sure that both libraries work with Seam.

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.

http://docs.jboss.com/seam/1.1GA/reference/en/html/concepts.html#d0e2420

Data-oriented applications

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.

http://docs.jboss.com/seam/1.1GA/reference/en/html/framework.html

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.

http://docs.jboss.com/seam/1.1GA/reference/en/html/gettingstarted.html

This work also involved improving Seam's extensions to JSF that allow the easy creation of applications with bookmarkable pages.

http://docs.jboss.com/seam/1.1GA/reference/en/html/events.html#d0e3357

J2EE support

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.

http://docs.jboss.com/seam/1.1GA/reference/en/html/concepts.html#d0e2831

Persistence context management

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.

http://docs.jboss.com/seam/1.1GA/reference/en/html/conversations.html#d0e4275

Asynchronicity

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).

http://docs.jboss.com/seam/1.1GA/reference/en/html/jms.html#d0e5041

JSF tag library

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.

http://docs.jboss.com/seam/1.1GA/reference/en/html/controls.html http://docs.jboss.com/seam/1.1GA/reference/en/html/validation.html

Sophisticated XML-based component configuration

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.

http://docs.jboss.com/seam/1.1GA/reference/en/html/xml.html

6 comments:
 
13. Dec 2006, 23:35 CET | Link
Joh
Why couldn't you use stateful session beans in J2EE? They work perfectly fine, right? Could you elaborate on that?

Thanks for the great release anyway :-)
 
13. Dec 2006, 23:40 CET | Link
Gavin
You mean EJB2 stateful session beans?

Well, for one, the programming model is ugly, for another there are no interceptors, so nowhere to weave in Seam's bijection, etc, and finally some J2EE servers don't have a very efficient implementation of SFSBs.
 
13. Dec 2006, 23:56 CET | Link
Joh
Ah! thanks, I'm just in the process of learning about Seam and its ups and downs when compared against Apache Tapestry.

I just can't stand it when something is said to "not work" without any explanation. It's like having pills where the packaging says "don't mix with alcohol"... I always have to know why :-).

I'm very grateful that my shop migrated to JEE 5 by now.
 
19. Dec 2006, 04:57 CET | Link
I am currently working with Oracle AS 10g, I am all excited to try some Seam 1.1 with 10g release 3. But it's only J2EE 1.4 compatiable with limited EJB 3 support.
In the J2EE support section, I am reading that Seam is compatible with J2EE and I can use either JPA or Hibernate. Can I really JPA? From my understanding that if you want to use JPA, you need either a EJB 3 container or JSE 5. You also said that there are some samples that deployed out of the box with WebLogic, could you tell me which version is that? 9 or 10? For 10, it comes with EJB 3 support.

Thanks for the great work on Seam 1.1
Thanks for the great Second Edition of Hibernation in Action book.

Tao
 
30. Oct 2007, 05:12 CET | Link

quote You mean EJB2 stateful session beans? Well, for one, the programming model is ugly, for another there are no interceptors, so nowhere to weave in Seam's bijection, etc, and finally some J2EE servers don't have a very efficient implementation of SFSBs. Very eloquently put Gavin. I totally agree with this rationalisation. Most j2EE servers in fact dont have a very efficient imprementation of SFSBs...

 
10. Oct 2008, 05:01 CET | Link

I've been watching the development of Seam 1.1 too and I find it very interesting. I'm sad to find out that it isn't what I've expected. I thought it would be the greatest thing that will make my day, but I was wrong..