Re: vertical inheritance by templating

From: Andrus Adamchik (andru..bjectstyle.org)
Date: Fri Jun 17 2005 - 15:57:09 EDT

  • Next message: Andrus Adamchik: "Re: vertical inheritance by templating"

    >
    > I guess I hadn't realized it was confusing at that level.
    >
    > But, yeah, vertical inheritance is the opposite of single-table
    > inheritance in one respect.
    >
    > STI splits a single database table into multiple java objects.
    > VI combines several database tables into a single java object.

    Still there is more than one way of looking at it ...

    I am reading the EOF docs now (never used ORM inheritance in my EOF days),
    and NeXT implemented it they way you describe it.

    There is also a note in the EOF docs: "...if you want to perform a deep
    fetch from Person, three fetches are performed: a fetch from Employee
    (with a join to Person), a fetch from Customer (with a join to Person),
    and a fetch from Person to retrieve all the Person attributes.."

    So in this respect it works sort of like horizontal inheritance.

    I was coming from the fact that master table and detail tables are all
    "one-to-one", so they share the same base ID, and when you fetch on
    master, you'll get the whole hierarchy at once. So in a query on a
    superclass we won't do an in-memory UNION, but will do an [outer] join
    instead (actually this will work like current prefetching I think). Does
    it make sense?

    So this looks like two different strategies (besides UNION implementation
    gives us horizontal inheritance for free). We can encapsulate them as such
    in the access stack, so that the same mapping can work with both.

    Andrus



    This archive was generated by hypermail 2.0.0 : Fri Jun 17 2005 - 15:57:10 EDT