Re: Local Object

From: Michael Gentry (mgentr..asslight.net)
Date: Fri Jul 09 2010 - 15:41:15 UTC

  • Next message: Andrus Adamchik: "Re: Local Object"

    I was thinking we'd add a utility type method for now. I have no
    expectations of modifying 3.0 for this, but was thinking it might be
    good in the future to have something similar.

    Thanks,

    mrg

    On Fri, Jul 9, 2010 at 11:18 AM, Andrus Adamchik <andru..bjectstyle.org> wrote:
    > I am not comfortable with adding a new public ObjectContext method that will
    > be hard to remove in the future. And I suspect it *will* be removed/renamed.
    > I know this is bad situation, as likely it won't get implemented quickly
    > (and most certainly not on 3.0 branch), and you would want to use it right
    > away... Maybe for now you'll create your own utility or a DataContext
    > subclass and we put the request in Jira?
    >
    > Andrus
    >
    >
    > On Jul 9, 2010, at 6:01 PM, Michael Gentry wrote:
    >>
    >> Our particular use-case is pulling objects into a child DC to edit and
    >> isolate changes.  Something like:
    >>
    >> User localUser = childContext.localObject(user.getObjectId(), user);
    >>
    >> Just seems like that can be simplified a bit for the developers.
    >>
    >> Thanks,
    >>
    >> mrg
    >>
    >>
    >> On Fri, Jul 9, 2010 at 10:50 AM, Andrus Adamchik <andru..bjectstyle.org>
    >> wrote:
    >>>
    >>> Actually "localObject" is too loaded, performing a set of vaguely related
    >>> distinct tasks... It has to be split into multiple methods (and IIRC we
    >>> discussed it briefly some time ago). This particular variety is closer to
    >>> "merge", vs. "localObject(id, null)" which is something like "locate"...
    >>> Since this is rather visible public API and there are some caveats, we
    >>> need
    >>> to give it some more thought I think, identifying all the scenarios
    >>> before
    >>> creating appropriate methods.
    >>>
    >>> Andrus
    >>>
    >>>
    >>> On Jul 9, 2010, at 5:36 PM, Michael Gentry wrote:
    >>>
    >>>> Would it make sense to add:
    >>>>
    >>>> public Persistent localObject(Persistent source)
    >>>> {
    >>>>  return localObject(source.getObjectId(), source)
    >>>> }
    >>>>
    >>>> to DataContext and friends?  We are starting to use that a bit here
    >>>> and it seems like it would be much simpler to me.
    >>>>
    >>>> Thanks,
    >>>>
    >>>> mrg
    >>>>
    >>>
    >>>
    >>
    >
    >



    This archive was generated by hypermail 2.0.0 : Fri Jul 09 2010 - 15:43:05 UTC