RE: pattern for adding entity in web environment

From: Scott Finnerty (scot..odefuey.com)
Date: Thu Jan 22 2004 - 14:23:26 EST

  • Next message: Bret Gregory: "Strange Update Overwriting with Null"

    Though I have no experience with tapestry (I typically use struts) I don't
    create the object until after the save-button is pressed. Until that point
    I use a bean (struts form) to pass to the view (which is the same for
    add/edit). In the case of an edit I retrieve the cayenne object and "copy"
    what's needed to the bean for the view.

    Scott Finnerty

    -----Original Message-----
    From: Tore Halset [mailto:halse..vv.ntnu.no]
    Sent: Thursday, January 22, 2004 4:19 AM
    To: cayenne-use..bjectstyle.org
    Subject: pattern for adding entity in web environment

    Hello

    I am using cayenne+tapestry and have a webpage with a list of users.
    There is a edit-link for every user and a add-user-link on top of the
    page. I use the same page for adding and editing users. It has a save
    and a cancel-button.

    When a user presses the add-user-link I use createAndRegisterNewObject
    to create a new user. The cancel-button will do a rollback and the save
    button will do a commit.

    Is createAndRegisterNewObject the best way to add a new user? What if
    someone does not use the cancel-button, but presses another link or
    perhaps the famous back-button in the browser? Would it be better to
    create a new unregistered user and register it on save?

      - Tore.



    This archive was generated by hypermail 2.0.0 : Thu Jan 22 2004 - 14:25:46 EST