Re: Nested ROP contexts and relationships

From: Andrus Adamchik (andru..bjectstyle.org)
Date: Tue Nov 24 2009 - 06:42:45 EST

  • Next message: Andrus Adamchik: "Accessing object metadata and other utilities"

    So here is a high-level question - do you think we can use
    ClassDescriptor/Property abstraction *internally* to build a unified
    ObjectContext implementation for any kind of objects? This was the
    goal of the reflect package anyways.

    > getEntityResolver
    > ().getClassDescriptor(object.getObjectId().getEntityName());
    > Too hard for user who does not know Cayenne internals I think

    Fine, but we are talking about two different things here - how to
    build a single context for DO and PO and how to build user interface
    for some specific convenience tasks. Let's discuss those 2 things
    separately.

    Andrus

    On Nov 24, 2009, at 1:37 PM, Andrey Razumovsky wrote:

    > 2009/11/24 Andrus Adamchik <andru..bjectstyle.org>
    >
    >>
    >> I did not, but I defined 3 different types of objects (ROP, POJO,
    >> JPA) that
    >> don't use this approach for setting reverse relationship. So that's
    >> what I
    >> mean by pluggable :-)
    >>
    >>
    > And now I want at least ROP-like classes do use this approach as
    > well (i
    > mean what is contained inside "setToOneTarget" method). I just want to
    > minimize duplicating the code. Alternatively, same code will be
    > added to the
    > places where we process those "different types".
    >
    >
    >>
    >> Property p = ClassDescriptor.getProperty(String);
    >> p.readProperty(Object);
    >> p.readPropertyDirectly(Object);
    >>
    >>
    > ...and more lines to get ClassDescriptor:
    >
    > ClassDescriptor cd = object.getObjectContext().
    >
    > getEntityResolver
    > ().getClassDescriptor(object.getObjectId().getEntityName());
    > Too hard for user who does not know Cayenne internals I think



    This archive was generated by hypermail 2.0.0 : Tue Nov 24 2009 - 06:43:22 EST