Subject | Re: [IB-Architect] Table Inheritance |
---|---|
Author | Dmitry Yemanov |
Post date | 2000-07-18T08:43:12Z |
>I proposed an alternative solution in which a base table containing,I think inheritance will be the best solution, because it concerns the
>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.
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,Unified semantic model. It makes possible working with the tables
>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.
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,My answer is 'yes'. Maybe the derived PK should have an ability
>c) declared primary key of extension table appended to primary
>key of base table (problem is that uniqueness of base table is
>problematic).
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 languageNo C++-like MI. Sometimes it's very useful thing, but I don't think
>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?
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