4 Replies Latest reply on Oct 6, 2005 9:52 AM by gavin.king

    Basic CRUD web app

      For simplicity's sake, I would consolidate it to one Action. In the add/change/delete process, you are dealing with one printer instance, or one reference within the CRUD Action.

      Conceptually, your Action has a Printer, either set one from a previous action/scope, or use one for creation. If you start to run into problems with referencing beans, possibly decrease your use of @In and @Out for everything and just specify your Action as a Seam Component and just reference that Actions properties via EL--

      #{printerAction.printer} vs. #{printer}

      It may help with readability too, while keeping lifecycle control of that printer within your Action itself.

      -- Jacob

        • 1. Re: Basic CRUD web app
          marobashi

          Jacob,

          Thanks for your prompt response. I'm looking forward to giving this a shot, and I appreciate your assistance.

          In the hotel example, there's only one action that can be performed over the hotel list, and there's only one "termination" point of the conversation (the confirm() method).

          If I have methods for add, change, and delete all within the same action,

          1) can I specify multiple methods with the @End annotation
          and
          2) Is it good design to do so?

          Thanks,
          --eric

          • 2. Re: Basic CRUD web app

            Yes, multiple @End used is appropriate.

            The conversation scope is defined by a series of contigous HTTP Posts, which may involve searching, selection, etc-- collecting data as you go, then allowing you to use the @End to finish the currently active conversation. It doesn't even have to be on the same Object.

            • 3. Re: Basic CRUD web app
              marobashi

              Have I mentioned that Seam is sweet?

              It seems so simple, I thought I just *had* to be misunderstanding something.

              Thanks again for the response.

              • 4. Re: Basic CRUD web app
                gavin.king

                :-)