Editor's Desk

Tuesday May 05, 2009

Where are the Conversations?

First, I want to say I'm extremely excited about JSF 2.0, and I think it's a major leap forward for the framework.

That being said, there's one thing that's been bugging me for a while: no built-in support for conversation scope. (For those who don't know, "conversation" scope is shorter than a servlet session and longer than a request, and is popular in frameworks like Seam, Spring Web Flow, MyFaces Orchestra, etc.).

By default, JSF 2.0 will leverage the controversial JSR 299 (Java Contexts and Dependency Injection, or JCDI) specification (formerly WebBeans). JCDI provides, among other things, support for conversations in a JSF environment. Both JSF 2.0 and JCDI will be part of Java EE 6, but users of existing containers will have to download a JCDI implementation, such as WebBeans, just to use conversations.

Good luck if you only want to use conversations -- JCDI adds quite a few other features which, although powerful, add conceptual complexity.

On the bright side, JSF 2.0 supports custom scopes, so adding conversation support is something frameworks like MyFaces Orchestra can add (developers can easily add their own scopes, too). But, then again, why do frameworks need to add support for something as common as a conversation scope? To me, and many people I've talked to such as Matthias Wessendorf, this seems like a natural fit for the Servlet spec. And, for all of the useful features in Servlet 3.0, this one is sorely lacking.

So, here's the bottom line:

Conversations should be part of the Servlet spec.

And remember, I'm saying this as a member of both the JSF 2.0 and JCDI expert groups. Once again, a key part of the Java platform is not implemented consistently across different layers of the stack...


Post a Comment:
  • HTML Syntax: Allowed