1 Reply Latest reply on Jul 17, 2006 1:26 PM by Gavin King

    General conversation question

    cdanielw Newbie

      I have a question on a, at least for me, very common use-case.

      First a disclaimer: I haven?t got my hands dirty with Seam yet. I?m more in the process of figuring out whether it fits my needs ? I?ve only read the documentation, browsed through the forums, blog posts etc. However, what I?ve seen so far looks very, very interesting. The idea of using stateful components really looks like it could help me overcome the biggest gripes I have with JSF (and other web-frameworks as well, for that matter).

      In order to keep things a bit less abstract, let?s take an application for managing persons and organizations as an example.

      The ?person? side of the application has the following functionality:

      ? Find a person
      ? Show overview of a selected person
      ? Edit general details of the person
      ? Manage the email addresses of the person
      ? Select which organizations the person works for

      The ?organization? side functionality:

      ? Find an organization
      ? Show overview of a selected organization
      ? Edit general details of the organization
      ? Manage a list of countries the organization where the organization operates

      So, the idea is that first an object is selected from a search result list (person or organization in this case), an overview of the object is displayed with functionality for manipulating the object (editing the name of the person, adding an email address to the person), in a non-wizard manner.

      Usually, the overview pages take the object identifier from the request parameter as this allows the overview pages to be bookmarked (e.g. /viewPerson.jsf?personId=42).

      So far so good ? now the problem is to propagate the selected person/organization through the manipulation actions. Here there are a number of options:

      ? Keep including the object identifier among the request parameters. This used to be my default way of handling this when using action based frameworks. However, JSF isn?t making this approach easy.
      ? Put the object itself in the session ? problems with LazyInitializationException ;-)
      ? Put the object identifier in the session.

      When using JSF, I usually end up with the last solution.

      So, after all this blabbering, my question is this: Can the conversational scope of Seam be of help in situations like this?

      The problem, as I see it, is that there is no natural end of the conversation. Maybe it makes sense to start the conversation when showing the person/organization overview. However, a user might select a person, add an email address and then jump straight to organization interface.

      Any ideas, suggestions or clarifications would be greatly appreciated :-)