Re: Flattened relationship support

From: Andrus (andru..bjectstyle.org)
Date: Wed Oct 16 2002 - 21:57:17 EDT

  • Next message: Andrus: "Re: Flattened relationship support"

    >The more I think about it, the more easy it seems. Which rings alarm
    >bells, and makes me wonder what I'm missing.

    Everything does sound right. We will need to pay attention to the following
    things though:

    1. DataMap loading
    2. DataMap saving
    3. Adding GUI after the backend is done
    4. Unit testing (actually adding a flattened relationship to the test model
    will automatically enable testing of 1 & 2)
    5. ... maybe something else I am forgetting now

    Andrus

    At 02:42 PM 10/17/2002 +1300, Craig Miskell wrote:
    >That does sound cool. If the user needs access to an intermediate
    >object/table, then flattened isn't the way to go (I think we did that once
    >in EOF, but it was a bad idea :-)).
    >
    >I am tending towards your second thought, that as far as the object graph
    >is concerned, it's just a toMany relationship at both ends. The only
    >thing that would need mod's adding/removing objects (CayenneDataObject,
    >but we can spin the details out to some other place, possibly
    >ObjRelationship?), and the creating appropriate joins in the query
    >translators.
    >
    >Just for convenience, I propose we use the following schema for
    >discussing:
    >
    >Person <-> Phone number
    >A given person may be possibly available at more than one number (mobile,
    >work, home), but each number may also reach more than one person (esp.
    >home/work).
    >
    >To get read support, we'd mod QueryHelper.selectRelationshipObjects and
    >create a OBJ_PATH expression like toPerson=<source object>, then let the
    >query translator figure out it needs to join. The path traversal would
    >notice that the ObjRelationship is flattened, and generate a join across
    >the DbRelationships that make it up.
    >
    >Write support (add/remove) would be specialised for flattened
    >relationships, and just create/delete rows in between.
    >
    >The more I think about it, the more easy it seems. Which rings alarm
    >bells, and makes me wonder what I'm missing.
    >
    >What do you think?
    >
    >
    >Craig Miskell
    >Programmer, Black Albatross, Otago University, New Zealand
    >-----BEGIN GEEK CODE BLOCK-----
    >Version: 3.1
    >GCS d- s+:- a-->? C++++(++)$ ULXH+++$>++++ P+>++++ L++$>++++$ E--- W+++$
    >N+ K? w--- !O M-- V? PS--- PE Y t++ 5 X+++ R-- tv+ b+>+++ DI++++ D+ G+ e++
    >h--- r+++ y+++
    >------END GEEK CODE BLOCK------



    This archive was generated by hypermail 2.0.0 : Wed Oct 16 2002 - 21:56:46 EDT