Re: Modeling Interfaces [Was: Modelling improvements: inheritance + interfacing (Draft)]

From: Aristedes Maniatis (ar..aniatis.org)
Date: Wed May 30 2007 - 05:32:46 EDT

  • Next message: Andrus Adamchik: "Re: Modeling Interfaces [Was: Modelling improvements: inheritance + interfacing (Draft)]"

    On 30/05/2007, at 7:16 PM, Andrus Adamchik wrote:

    > What I am concerned about with DbEntity interfaces is that
    > DbEntities model database tables and there is no interface concept
    > in DB world. So I still don't understand why we need DbEntity
    > inheritance? Could you please elaborate or give some examples?
    >
    > The only use I can see for it is a *coincidental* match between
    > groups of attributes in multiple tables. So is it worth
    > complicating the mapping by introducing a concept with no analog in
    > the DB world? My suspicion is that it will be very hard to explain
    > to the users.

    Perhaps 'interface' is just the wrong word. The idea is similar to
    the WO prototype idea and the most common example is 'money' - you
    can define a money type once as having scale=2 and then just use that
    in all the dbEntity attributes.

    Interfaces in ObjEntities are completely different things again. They
    create actual interfaces in the Java classes. Perhaps we should also
    shed some of these extra ideas for now and focus on the main goals:

    1. abstract classes
    2. horizontal inheritance (where dbEntity=NULL for an objEntity)
    3. vertical inheritance (where a special ObjRelationship is created
    to specify the superclass. There may also need to be a qualifier like
    with single table - Lachlan thinks yes, I'm dubious.)

    I believe that is the right order to implement the ideas (easiest to
    hardest).

    Simultaneously we can work on interfaces. This has two steps:

    1. implement interfaces in the modeller, XML, datamap and class
    templates but have no runtime code in Cayenne for them. This is very
    easy and quite useful on its own.
    2. implement the ability for SelectQuery to return a mixture of
    objEntities based on a query of the interface

    They don't really overlap that much except that some of the issues
    faced in making queries work may be applicable to both interfaces and
    inheritance.

    Finally we have dbEntity interfaces (prototypes) which maybe need
    another name and are something different again, but maybe we can cut
    them out of this whole conversation and return to them later?
    Lachlan, can we drop this one for now?

    Ari

    -------------------------->
    Aristedes Maniatis
    phone +61 2 9660 9700
    PGP fingerprint 08 57 20 4B 80 69 59 E2 A9 BF 2D 48 C2 20 0C C8





    This archive was generated by hypermail 2.0.0 : Wed May 30 2007 - 05:33:19 EDT