All I can find about "inheritance" support in Rose talks about database
driver
implementations.
I'm interested in support for inheritance in the OO to SQL mapping.

As I'm sure you all know, there are several ways that is accomplished
in different applications. For example, in the simple case
of a single base class (e.g. "Contact") with multiple concrete
subclasses
(e.g. "Customer" and "Vendor")

1. Table per class (aka "union mapping" aka "filtered mapping")
a single table with pkey corresponding to the base class, and
a table for each subclass table sharing the same pkey.
the "base class" table has a discriminant column in addition to
its pkey value.
pro: optimal storage, and can use "NOT NULL" appropriately
con: foreign key to a base class is a little awkward
con: query requires a join to get all columns

2. "Table per instantiable class" (aka "horizontal mapping")
a table for each instantiable subclass. each table has all columns,
including pkey and all inherited columns. There may not be anything
to ensure pkey uniqueness across these multiple tables.
pro: query by class is easy
con: following a foreign key to a base class (can go to any subclass) is
awkward

3. "Table per hierarchy"
a single table that a union of all columns from all subclasses.
it has a pkey and a discriminant column.
pro: following foreign key is easy, to any class in hierarchy
con: wastes some storage, and can't use "NOT NULL" for leaf columns
con: query requires hooking to filter rows and columns by discriminant

For more discussion in the context of a java OR solution, see:
   http://www.developer.com/java/web/article.php/10935_3559931_5

Any how, I can't find any documentation about any of this
with Rose::*. (That isn't unusual; so far as I can determine,
not a single one of the jillion perl OR solutions has anything
documented about this so basic OR design issue.)

Are there some docs I'm missing?

-mda





-------------------------------------------------------
SF.Net email is sponsored by:
Tame your development challenges with Apache's Geronimo App Server. Download
it for free - -and be entered to win a 42" plasma tv or your very own
Sony(tm)PSP.  Click here to play: http://sourceforge.net/geronimo.php
_______________________________________________
Rose-db-object mailing list
Rose-db-object@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rose-db-object

Reply via email to