Subject Re: [IB-Architect] Table Inheritance
Author Vince Duggan
All,

Jason Wharton wrote:
>
> I'm with Jim. Let's work with strict inheritance for polymorphism and see
> where that gets us.
[SNIP Jason's discussion of how to implement a polymorphic database
model]

I want to reiterate a few things I mentioned in a previous post, and
perhaps expand on them a bit.

The original query was to do with making things easier to create tables
with common triggers, so that each trigger need not be defined
separately. This sounds like OO and inheritance and polymorphism etc,
but it need not be.

InterBase is not an OO database, and probably should never be. It's a
straight forward relational database. If we are going to implement a
method to 'inherit' triggers, it should be within the current overall
method of doing things.

Currently, when one creates objects (tables, SPs, triggers etc)
everything is compiled at creation time, and set in stone in the system
tables. The one exception is field types/domains, which can be changed
on the fly later, but even this will not necessarily cascade into
trigger/SP code.

Some people have suggested that if one creates 4 tables which each
extend (or are based on) a single base table, then one should be able to
select from the base table and see all rows and common columns from the
4 descendents, and perhaps store indexed values for all 4 tables within
one super-index. In my opinion this is such a fundamentally different
way of doing things, we may as well write another database engine, and
call it something other than InterBase.

Keep it straight and simple. By all means extend the DDL syntax to allow
one to create a table based on another table, and allow the new table to
'inherit' all the columns, indexes, constraints, triggers etc. After
that, there need be no link between the new table and the base table,
unless one provides a mechanism to cascade changes to the base table to
all descendants.

No polymorphism, no interfaces, no runtime work to check up the chain to
see if ancestors have changed etc.

In other words, this will simply be a method to streamline the CREATION
of a database, not a method that modifies the RUNTIME behaviour of the
database.

Vince


--
Vince Duggan
Synectics Software
Inprise C/S Business Partner
South Africa
http://www.synectics.co.za
mailto:vince@...