8 Replies Latest reply on Dec 14, 2005 2:23 AM by Gavin King

    Design suggestion

    Manuel Gentile Newbie

      Hi
      I have to design the follow use case:
      A search page to select an entity for a view page.
      For this view page i want to allow to go in a modify page and after modify return to view page.

      I just implement edit page and editign SFSB as a conversation.
      The search is a conversation too.


      The problem is when i back to view page is it possible to recover the "Search vonversation" or instead i have to start new conversation. in the second case how can i start new conversation automatically ?

      Thanks

      Gavin good work (RequestParameter is very nice feature!!!)

        • 1. Re: Design suggestion
          Patrick Angeles Novice

          Seam doesn't support multiple nested conversations at this point.

          So for now you have two choices:
          1. search query in conversation scope, edit on event scope.
          2. search query and edit in the same conversation scope.

          • 2. Re: Design suggestion
            Manuel Gentile Newbie

            maybe i solve my problem.....

            i use a dummy properties that i put in the view page. the getter of this properties is marked @Begin....

            any time i go to this page i begin the conversation and now i can search----> view edit and review the entity....

            whitout any error!!!!

            is it possible?????

            seem to apper the same effect of a nested conversation (editing) inside a view conversation

            :-)

            • 3. Re: Design suggestion
              Gavin King Master

              Better to keep your search results in session scope, IMO.

              • 4. Re: Design suggestion
                Manuel Gentile Newbie

                Must i set Search SFSB SCOPE Session???
                or i just mark the Scope of Entity Searched Session?

                • 5. Re: Design suggestion
                  Patrick Angeles Novice

                  Probably not a good idea to scope SFSB to session. You could create a search result object (a real POJO, not an Entity Bean, unless you want to persist your search results which sounds crazy) and put that in the session scope.

                  • 6. Re: Design suggestion
                    Gavin King Master

                    Why do you think it's bad to put an SFSB in the session? I think that's ok....

                    • 7. Re: Design suggestion
                      Patrick Angeles Novice

                      Seems weird...

                      First of all, it won't be freed up until the session is invalidated or the app takes it out of the session context. Then, I'm not too sure how it will behave wrt activation/passivation.

                      I think the web layer also does its own bit of passivation/activation and writes objects in the session context to disk (depending on configuration)... maybe this is different when you're running tomcat inside of a J2EE container but I'd rather not muck with that :)

                      Anyway, I think the real reason is that it's cleaner to think of the web layer as a "client" of the EJB container.

                      • 8. Re: Design suggestion
                        Gavin King Master

                         

                        "patrick_ibg" wrote:
                        First of all, it won't be freed up until the session is invalidated or the app takes it out of the session context.


                        Well, that just means you should make sure it isn't too huge and/or configure appropriate passivation. It's a tradeoff of performance vs. usability. You can't make an a priori blanket call on something like that.

                        "patrick_ibg" wrote:
                        Then, I'm not too sure how it will behave wrt activation/passivation.

                        I think the web layer also does its own bit of passivation/activation and writes objects in the session context to disk (depending on configuration)


                        All this is perfectly fine. All references b/w the session and the stateful beans are indirected via a local interface and can be reconstructed. Note that this same problem affects conversation scope, since it also "persists" to the HttpSession.

                        "patrick_ibg" wrote:
                        Anyway, I think the real reason is that it's cleaner to think of the web layer as a "client" of the EJB container.


                        I guess that's a metaphysical argument I don't want to get into, but I'll simply say that I disagree with this understanding of the problem.