• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

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

 
best scout
Posts: 1294
Scala IntelliJ IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Author
Posts: 134
5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 1294
Scala IntelliJ IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Author
Posts: 134
5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 1294
Scala IntelliJ IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Author
Posts: 134
5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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.
 
Author
Posts: 164
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
reply
    Bookmark Topic Watch Topic
  • New Topic