aspose file tools*
The moose likes JSF and the fly likes Why doesn't JSF 2.0 have a conversation scope like Seam? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSF
Bookmark "Why doesn Watch "Why doesn New topic
Author

Why doesn't JSF 2.0 have a conversation scope like Seam?

Marco Ehrentreich
best scout
Bartender

Joined: Mar 07, 2007
Posts: 1282

Hi ranchers,

when I read about JSF 2.0 and the new features and improvement I've often wondered why the concept of a conversation scope in JBoss Seam didn't make it into JSF 2.0. Unfortunately I've not yet heard or read what's the reason for it. When I first learned about the features of Seam some time ago this seemed like a very powerful mechanism to easily create modern web apps where the developer doesn't have to care about low level details for multiple browser windows or tabs. The "workspace" concept looked very promising to me at this time.

Is there any good reason why it was not included in JSF 2? Or does JSF 2 by chance offer a similar features which was just not named conversation scope?

Marco
Jason Porter
Ranch Hand

Joined: Apr 26, 2007
Posts: 120
You can create your own scopes in JSF 2, so you could create your own conversation scope; however CDI has a conversation scope already so you might as well use that one.
Marco Ehrentreich
best scout
Bartender

Joined: Mar 07, 2007
Posts: 1282

Hi Jason,

thanks for your answer. I already read that you can create own scopes now but I couldn't find the time to learn more about. A problem for which I can't see a readily available solution here is the way Seam splits a user's HTTP session into the more fine grained conversations and also takes care for the mapping of different browser tabs/windows (by using a hidden ID if I remember correctly). Is there something similar in JSF 2.0?

Marco
Jason Porter
Ranch Hand

Joined: Apr 26, 2007
Posts: 120
Not that I know of, you'd have to built it yourself, which is the reason for using the CDI conversation.
Marco Ehrentreich
best scout
Bartender

Joined: Mar 07, 2007
Posts: 1282

That was exactly what I mean: I can't see how CDI can help here to solve these problems in the view layer. Maybe I have to check out some more details and think about what it would mean to combine CDI with the ideas of Seam's conversations.

Marco
Jason Porter
Ranch Hand

Joined: Apr 26, 2007
Posts: 120
Marco Ehrentreich wrote:That was exactly what I mean: I can't see how CDI can help here to solve these problems in the view layer. Maybe I have to check out some more details and think about what it would mean to combine CDI with the ideas of Seam's conversations.

Marco

CDI conversations are pretty much the same thing as Seam's conversations. The only thing you can't do with them (at least not atm) is nested conversations.
Dan Allen
Author
Ranch Hand

Joined: Mar 05, 2003
Posts: 164
The decision to implement the conversation scope within JSF was deferred as it was decided that it would be more appropriate to implement the scope at a level in which it could be shared/accessed across the Java EE platform. Scopes which provide this level of visibility are defined in JSR-299: CDI. Therefore, the official conversation scope for JSF is indeed the conversation scope defined by JSR-299.

However, because of the order in which the specifications were finalized, JSF 2 wrapping up nearly 6 months before CDI, it was not possible for JSF 2 to provide UI components that would aid in managing the boundaries of the conversation scope like Seam provides. Now that CDI is officially part of the Java EE platform, you can expect that, moving forward, we can take steps in JSF to help support the conversation scope.

One consequence of the decision to move the conversation scope to CDI meant that it's necessary to use JSF 2 in conjunction with CDI. This turns out to be a good thing because the services that CDI provide (dependency injection, managed bean discovery/definition, events, etc) go way beyond the JSF managed bean facility and is well worth the commitment. I recommend this strategy strongly over trying to implement a conversation scope using the JSF 2 custom scopes.


Dan Allen | http://mojavelinux.com | Author of Seam in Action - http://mojavelinux.com/seaminaction
 
Consider Paul's rocket mass heater.
 
subject: Why doesn't JSF 2.0 have a conversation scope like Seam?