Subject Re: [IB-Architect] Table Inheritance
Author Dmitry Yemanov
>I proposed an alternative solution in which a base table containing,
>among other stuff, the fields last_update_date and last_update_user
>and the triggers to maintain those fields. Other tables could then
>"extend" the base table, inheriting both the fields and the triggers.

I think inheritance will be the best solution, because it concerns the
fields as well as the triggers. It maybe very powerful, if we'll solve all
appropriate problems. Besides, inheritance has good conceptual basis
and we can reuse some OO ideas.

>Question 1: Does table inheritance simply mean attribute (fields,
>triggers, primary keys, indexes) inheritance, or does it mean a
>a unified semantic model? We could, of course, have both, but
>for the sake of elegance, lets assume one or the other.

Unified semantic model. It makes possible working with the tables
at any level of hierarchy. If I've got one base table and a lot of
derived tables, the base table should look like a separate business
object, which exists and can be used independently. But I think it
can't be done without touching the engine.

>Question 2: Are primary key inherited? Choices: a) yes, b) no,
>c) declared primary key of extension table appended to primary
>key of base table (problem is that uniqueness of base table is
>problematic).

My answer is 'yes'. Maybe the derived PK should have an ability
to override the base one. I use surrogate unique keys for all my
tables, and, to the best of my knowledge, it will work. But the
natural keys may cause problems in this case.

>Question 3: Is multiple inheritence necessary? Most language
>designers would say that multiple inheritence is mother natures
>way of telling you that your design is screwed up. Multiple
>inheritence in C++ is moby complicated and usually does the
>wrong thing. Java dump it in favor of single inheritance
>plus implementation of interfaces (polymorphism without
>representation). What is the minimal feature set we can live
>with?

No C++-like MI. Sometimes it's very useful thing, but I don't think
it's a good design strategy in common. I like Java object model,
so I'd love to see such thing as interface inheritance.

Best regards,
Dmitry