14 Replies Latest reply on Sep 17, 2007 5:39 PM by stephen.friedrich

    Last try - Conversational Feature let me feel like an idiot

    maku01

      Hi,

      I think I understand the benefits of the usage of a "conversational" approach and how I can use it from a design point of view.

      But I'm REALLY not be able to implement this with Seam.
      I spent much time to read about this topic in a book (Yuan + Heute) and the Seam reference and I tried also to study the booking example.

      Here my problem:

      I want to have a simple menu for different logical areas (e.g. partner, service, reports and so on)

      When I click one menu entry I want a "conversation" for this logical area until the conversation is ended by the user or a timeout occurrs.

      When another click on a menu entry occurrs whera a conversation already exists this conversation should be used.

      It should be possible to change the activated logical area and to come back without loosing the state.

      This means for me a kind of a workspace which many logical areas in ONE window.

      Could anybody give me a hint how to implement this in Seam (I use Seam 2 CVS)?

      I experimented already with different approaches but without much success. When I work with Session State this isn't a problem.

      TIA

      Martin

        • 1. Re: Last try - Conversational Feature let me feel like an id
          christian.bauer

          It is very unlikely that you actually _need_ conversation scope if the user simply navigates into an area. Why do you think you need it?

          • 2. Re: Last try - Conversational Feature let me feel like an id
            maku01

             

            "christian.bauer@jboss.com" wrote:
            It is very unlikely that you actually _need_ conversation scope if the user simply navigates into an area. Why do you think you need it?


            The kind of the application is an administration application.

            Most of the views should be master / detail views with a list view (for searching and selecting) at the top of the view and a detail view representing the selected detail.

            When I switch between the logical areas I want to preserve the state of the other logical areas. I don't want to loose the information. The user should explicitly end the "unit of work".

            An additional possible feature would be to work with more than one instance of a logical area (e.g. access to two customers at the same time )



            • 3. Re: Last try - Conversational Feature let me feel like an id
              stephen.friedrich

              That's exactly my use case and I don't have a solution either.
              Currently the first version of my app works without using conversations which of course seems to waste quite a lot of seams value.

              A big problem is that _all_ the explanations teach you about the technical side, e.g. what a conversation is, how it is started and ended, etc.
              But there isn't any documentation at all how to do user interface design with conversations in mind or how to apply conversations to an existing UI design.

              This particular scenario (different areas/tabs, list in each area, detail view for selected item) which is quite typical has come up several times already in the forum and it was never really answered.

              I think I need to start a conversation to avoid reloading the list (in an "area") from DB again and again if I just sequentially select multiple items to view each one's details.
              Also when I currently edit, say, a project's details I would like to be able to shortly switch to the customer view to be able to look up some information there and then continue back in the project details.

              • 4. Re: Last try - Conversational Feature let me feel like an id
                pmuir

                Yes, an example application of this sort would be a great addition to the Seam examples I think. Does anyone have something they can donate?

                • 5. Re: Last try - Conversational Feature let me feel like an id
                  christian.bauer

                  ?! It's not different from any of the existing examples. You need to understand how propagation="none" and propagation="join" work, and that's it.

                  • 6. Re: Last try - Conversational Feature let me feel like an id
                    stephen.friedrich

                    Now I, too, feel like an idiot because each example should be showing this, but I still don't get it after looking at several different examples.

                    "christian.bauer@jboss.com" wrote:
                    ?! It's not different from any of the existing examples. You need to understand how propagation="none" and propagation="join" work, and that's it.

                    That seems to be quite an exaggeration.
                    After a quick scan it seems that exactly a single example uses propagation="join" and that's the ui example - hardly a place where I would check how conversations should be used.

                    Of course most examples make use of conversations somehow.
                    It may also be true that after you understand conversation propagation the proposed example isn't much different from the others, but again that's a technical point of view.

                    Also I think each example should highlight a specific feature or concept.

                    Pete, obviously I can't supply a ready made example. What I can do however is to provide a working example that maybe you - or another 'insider' - can comment on, so that I can enhance it to make use of conversations in the best way.
                    I am thinking about a drastically stripped down version of our app, containing three "areas": "Employees", "Projects", "Project Assignments".


                    • 7. Re: Last try - Conversational Feature let me feel like an id
                      pmuir

                      Stephen - sure, I'm not really expecting a full example (with nice explanation text etc.) - but something is better than nothing. At least like this we can get a better understanding of what you are after. Despite what Christian says, I do feel we are lacking an example that uses workspace management well (apart from the wiki, which does, but isn't exactly easily understandable by the casual user).

                      • 8. Re: Last try - Conversational Feature let me feel like an id
                        christian.bauer

                        Any seam-gen application uses propagation="join".

                        • 9. Re: Last try - Conversational Feature let me feel like an id
                          maku01

                           

                          "christian.bauer@jboss.com" wrote:
                          ?! It's not different from any of the existing examples. You need to understand how propagation="none" and propagation="join" work, and that's it.


                          In my opinion, this statement is really an oversimplification.

                          I tried to understand the conversation mechanisms and I'm aware that the use of a propagation="none" starts a new conversation.

                          But when a new conversation was created I've to manage the conversation in context.
                          E.g. when a menu entry for a special logical area is activated I start a new conversation (with propagation="none" and a "start" Method marked as @Begin)
                          On the next activations of this menu entry, a conversation is already active I've to know that a conversation is already in progress and handle this scenario appropriately

                          I tried to handle this by specifying a conversion id (with @Begin(id=...) or I tried to specify this conversion id in pages.xml

                          E.g.

                          <conversation name="PartnerMaintConv"
                           parameter-name="cid"
                           parameter-value="PartnerMaintConv"/>


                          and
                          <page ... conversation="PartnerMaintConv" >
                          </page>
                          


                          But this works not as I expected.


                          When I start a new conversation with every menu click (with propagation="none") and use e.g. the Seam switcher component it seems that this works at the first sight.

                          So I could imagine that it would be possible to build a logic that change the behaviour of a menu entry when I conversation is already active and do something similiar like the "switcher" component.

                          Could this be a possible approach??

                          By and large I've to say that to implement this requirement for a business administration application is not easy with Seam (maybe it is when you really understand what's going on). But from the point of view of a average Seam user it is not.

                          When I implement this with components with "Session" state it is simple to do. I don't want to loose the Seam benefits.
                          But I'm already really frustrated.














                          • 10. Re: Last try - Conversational Feature let me feel like an id
                            stephen.friedrich

                             

                            "christian.bauer@jboss.com" wrote:
                            Any seam-gen application uses propagation="join".

                            Maybe, but those have no comments in them, no javadocs and the "The Seam Application Framework" chapter in the reference does not talk about conversations either.

                            Funny things is that even though you always recommend to start with a seam-gen'ed app all the supplied examples (that do have some comments and javadoc in them) seem to be handcrafted.

                            But sure - that probably a valueable tip and I'll look at a seam-generated app in more depth.


                            • 11. Re: Last try - Conversational Feature let me feel like an id

                              I wouldn't recommend reusing the same conversation in different areas of the system. Whenever user switches to a different area, scrap the old conversation and create a new one. You can do it in the same request, by ending it in the link itself (via propagation="end") and beginning a new one in pages.xml (begin-conversation join="true").

                              • 12. Re: Last try - Conversational Feature let me feel like an id
                                stephen.friedrich

                                 

                                "ASavitsky" wrote:
                                I wouldn't recommend reusing the same conversation in different areas of the system. Whenever user switches to a different area, scrap the old conversation and create a new one. You can do it in the same request, by ending it in the link itself (via propagation="end") and beginning a new one in pages.xml (begin-conversation join="true").


                                This isn't about reusing a conversation in different areas. It is about navigating again to the _same_ area and continuing with the original conversation there.

                                Specifically: Why do you need join="true" if you just have ended the previous conversation with propagation="end"?

                                • 13. Re: Last try - Conversational Feature let me feel like an id
                                  delphi'sghost

                                   


                                  Specifically: Why do you need join="true" if you just have ended the previous conversation with propagation="end"?


                                  He talked about starting a new one with join=true. The join=true bit ensures that you don't start a new one each time the page is rendered.

                                  maku01 :

                                  Regarding the conversation tags in pages.xml, I believe (and I could be wrong on this) that you need to rephrase the constant to something like :

                                  <conversation name="PartnerMaintConv"
                                   parameter-name="cid"
                                   parameter-value="#{PartnerMaintConv}"/>
                                  


                                  The constant should force a reuse of the conversation that you are looking for, although there are some problems with this mechanism which are currently being fixed.


                                  http://jira.jboss.org/jira/browse/JBSEAM-1423


                                  Proper use of conversations has been a thorn in my side for a while. If you notice, most Seam example apps have very little editing in them, and there is no master detail editing involved. The issue tracker was the only one with any kind of editable features, including master/detail and nested editing, but it was pulled in 2.0, possibly because it wasn't working properly.
                                  There is very little in the way of best practices for Seam, and everyone seems to be off doing their own thing and muddling together a solution.

                                  Pete, you've seen my sample bookstore app from my Jira issue (#1423), I have a couple of different ones (including something similar to the issue tracker) that I have been using to test this stuff out. I'm more than happy to donate something. The only caveat is that it uses the same kind of mechanisms as the bookstore app (RESTFul URLS, no @Begin annotations, and parameter passing) since it seems that this is the best way to develop a seam app that is well decoupled and a little more lightweight (i.e. not invoking new beans into a conversation that doesn't need them or is about to end). If you guys are interested, just let me know what I need to do with it to get it up to scratch.

                                  I think the two things seam needs right now is some indication of best practices, and some more diverse examples, and there is some overlap of those two issues.
                                  The documentation and examples are great for describing what you can do, but not always what you should do. There needs to be a little bit more diversity in the examples that highlight how to solve the problems people face on a daily basis, or at least indicate which problems can't be solved so we know we need to design around those issues (i.e. master/detail editing with nested conversations).



                                  • 14. Re: Last try - Conversational Feature let me feel like an id
                                    stephen.friedrich

                                    Pete, I posted a tiny little first example of what I am trying to do:
                                    http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4085264#4085264

                                    If you could have a look at the open issues I mentioned, that would be great!