Re: Relationships without FK constraints?

From: Juergen Saar (juerge..saar.org)
Date: Sat Mar 28 2009 - 11:10:30 EDT

  • Next message: Joseph Schmidt: "Re: Relationships without FK constraints?"

    The thread started with the aspect of reverse engineering.

    My project has started on 1987 ... first with 4GL, later with FoxPro, later
    for the Web java and cayenne and now a little .net
    Even a 3rd party product based on java manipulates data in database.

    And all those players are still active .... you can guess what fun it is ...

    Cayenne was very helpful in this process, because It is pretty easy writing
    helpers based on the cayenne classes.
    In my case I wrote a little helper the enhances the cayenne maps with our
    name-conventions, so that there were only a little handmade changes with the
    help of the modeler.

    A second helper makes the information from the maps available for crystal
    reports.
    ( OK, I don't like it, but the jasper designer had not the needed ease of
    usage )

    Why I'm writing this ... I think in complex projects you never reach your
    aim with pure cayenne ... you have to implement some little helpers

    2009/3/28 Joe Baldwin <jfbaldwi..arthlink.net>

    > Juergen,
    >
    > Your comments are along the line of what I was considering.
    >
    > I have worked on a number of large projects that are database driven and
    > have found that you can get yourself (and your design team) into a lot of
    > trouble by designing for a single framework. It is my experience that a
    > database (even one designed primarily to work with Cayenne or RoR) should
    > also be able to function as a stand-alone relational database. This way you
    > can leverage other tools like report writers and external apps like
    > datasource integrators.
    >
    > I used Cayenne-Modeler to reverse engineer my initial database design and
    > am now using it quite effectively to manage all of my design changes.
    > However, the database still maintains a cogent relational perspective even
    > when the Cayenne layer is eliminated.
    >
    > The intent of my comments and questions revolve around the state-of-the-art
    > wrt best design practices in the context of new and experimental frameworks
    > and design patterns.
    >
    > "Convention over Configuration" can be useful (and fast) in simple
    > implementations (ex: JSP form assignments) but may still be a bit too
    > "fuzzy" for the larger scaleable projects.
    >
    > These are my current opinions. I am interested in how others look at it.
    >
    > Joe
    >
    >
    >
    >
    > On Mar 28, 2009, at 7:51 AM, Juergen Saar wrote:
    >
    > There are 2 ways ... you can do it in database or in a framework like
    >> cayenne
    >>
    >> The framework way is best for being database independent
    >>
    >> The database way is best for databases being accessed on different way ...
    >> let's say java and .net ... in those constellations you otherwiese would
    >> have to do multiple inplementations
    >>
    >> In most cases you will find a mix of both
    >>
    >>
    >> 2009/3/27 Joe Baldwin <jfbaldwi..arthlink.net>
    >>
    >> I am curious: how are your related-tables managed in a relational
    >>> database
    >>> without FK's? Is there no RDB perspective in the design?
    >>>
    >>>
    >>>
    >>>
    >>> On Mar 27, 2009, at 2:33 PM, Joseph Schmidt wrote:
    >>>
    >>>
    >>> Just reread your question.. Sorry for
    >>>>
    >>>>> misleading. This is true, Cayenne
    >>>>> cannot know about relationships in DB without FKs. So you
    >>>>> have to map them
    >>>>> manually
    >>>>>
    >>>>> Adding manually is not efficient for most cases (too big databases)
    >>>> :(.
    >>>> (This would not convince users to ditch RoR's ActiveRecord for Cayenne
    >>>> :(
    >>>> ).
    >>>>
    >>>> I added a feature request for this:
    >>>> https://issues.apache.org/jira/browse/CAY-1202
    >>>> since Cayenne could infer these relations if they respect the
    >>>> convention.
    >>>>
    >>>> Thanks,
    >>>> Joseph.
    >>>>
    >>>>
    >>>>
    >>>>
    >>>>
    >>>>
    >>>
    >



    This archive was generated by hypermail 2.0.0 : Sat Mar 28 2009 - 11:11:06 EDT