Re: modifying relationship list

From: Marcin Skladaniec (marci..sh.com.au)
Date: Mon Jun 19 2006 - 01:38:21 EDT

  • Next message: Tomi NA: "Re: modifying relationship list"

    Thanks for clarification.

    Marcin

    On 19/06/2006, at 3:30 PM, Andrus Adamchik wrote:

    > Marcin,
    >
    > This is the expected Cayenne behavior on the server and on the
    > remote client. It is designed to simplify relationship management
    > and avoid object graph inconsistencies. I actually find it very
    > useful. You are right about the implications, but I guess users
    > should simply be aware of such behavior and implement their code
    > accordingly.
    >
    > Andrus
    >
    >
    > On Jun 19, 2006, at 8:42 AM, Marcin Skladaniec wrote:
    >
    >> Hello
    >> Just run into interesting cayenne feature.
    >>
    >> This code:
    >>
    >> rooms = site.getRooms();
    >> rooms.remove(aRoom);
    >>
    >> would alter the relationship
    >>
    >> so aRoom.getSite() is now null
    >>
    >> I'm wondering if this is a desired effect ?
    >> This behavior might cause bugs. When someone actually puts code to
    >> know the fact of relationship being changed (ie. put code into
    >> Room setSite() and Site add/removeFromRooms()/setRooms() methods )
    >> he might be disappointed, as those methods would not run, but the
    >> relationship will change...
    >>
    >> Regards
    >> Marcin
    >>
    >>
    >> -------------------------->
    >> ish
    >> http://www.ish.com.au
    >> Level 1, 30 Wilson Street Newtown 2042 Australia
    >> phone +61 2 9550 5001 fax +61 2 9550 4001
    >>

    -------------------------->
    ish
    http://www.ish.com.au
    Level 1, 30 Wilson Street Newtown 2042 Australia
    phone +61 2 9550 5001 fax +61 2 9550 4001



    This archive was generated by hypermail 2.0.0 : Mon Jun 19 2006 - 01:38:46 EDT