Re: [suggestion] unmodifiable toMany lists

From: Dirk Olmes (dir..anthippe.ping.de)
Date: Wed Nov 11 2009 - 01:13:24 EST

  • Next message: ïÌØÇÁ ôËÁÞÅ×: "Re: tests against other databases"

    >> - implement custom collections that are ObjEntity aware and "do the
    >> right thing" when touched.
    >>
    >> I haven't looked at the Cayenne source for quite some time now but IIRC
    >> the code currently does the second option above ...
    >
    > Right. They are...but this (I believe) is too easily exposed to user
    > code. e.g.,
    > for (Bar relation : foo.allBars()) {
    > if (some condition) {
    > foo.removeFromAllBars(relation); // will throw exception
    > }
    > }

    Err, why is this? Because you're modifying the collection you're
    iterating over? I'd rather fix the iterator then.

    -dirk



    This archive was generated by hypermail 2.0.0 : Wed Nov 11 2009 - 01:15:45 EST