| Oracle FAQ | Your Portal to the Oracle Knowledge Grid | |
Home -> Community -> Usenet -> comp.databases.theory -> Re: OO and relation "impedance mismatch"
Tony Andrews wrote:
>
>> > Another question: how can you generate the code for your triggers
>> > the data dictionary, when your data dictionary doesn't know about >> > primary keys, unique keys, foreign keys? >> >> Since I designed my dd, I put the keys into it. As stated in the
>> sub-thread on this, by dd I mean my own set of information, not
>> provided by the vendor.
I'm going to post separate replies for each line of discussion.
For this one: Ouch! no no no, there is no duplication of effort. My other post "Specifying all biz rules in relational data" may give you some insight into where I am coming from with this, but here is a recap:
The dd as designed by me for me is the sole authoritative repository for biz rules out of which I can generate DDL and application code. This is fundamentally different from the various system catalogs provided by all DBMS vendors (and only Oracle seems to call it a dd) that in one way or another let you determine *after* *the* *fact* the details of the database's construction.
Here is an example of how different they are. Question: if you were designing a dd, and had complete freedom to do it anyway you wanted, how would you specify a foreign key? Well, we always start with the absolute simplest way and then embellish, so we get:
You now have the simplest possible normalized way to store foreign key definitions. But if you look at the system catalog for SQL Server or DB/2, you will see that they define foreign keys in terms of lists of columns. Listing columns for the parent table is denormalized, they should list the key name and from that we get a list of columns. The vendor-supplied system catalog therefore is non-ideal as an authoritative source of information on the schema.
But further, the vendor-supplied catalog is by definition proprietary, so it cannot be used to export a db schema definition from one vendor and build it on another, because they are not compatible. To get the ability to build your systems on more than one platform, you need your own off-line dictionary that is outside of the database being built (though I put a copy into the database when the build is finished).
-- Kenneth Downs Use first initial plus last name at last name plus literal "fam.net" to email meReceived on Wed Oct 06 2004 - 13:08:15 CDT
![]() |
![]() |