in reply to Re: OO concepts and relational databases
in thread OO concepts and relational databases
Data integrity is orthogonal to stored procedures and triggers. Data integrity is maintained by normalization and foreign keys1. Triggers and stored procedures are the ability to use a programming language that is supported by the database engine. They are not necessary for data storage or to maintain data integrity. In fact, the entire idea of stored procedures is marked as "implementation-specific" in the ANSI-92 standard.
Now, triggers can be used to help maintain data integrity. The most obvious case is if you have a schema that has been deliberately denormalized for performance reasons. If you make a modification to table A, table B might need to be updated in an atomic fashion, to maintain the denormalization. However, that is outside the basic functions of an RDBMS.
As for triggers and stored procedures being behaviors ... I still maintain they are not truly behaviors, in the OO sense. The table doesn't have a behavior that is associated with it. If anything, the behavior is associated with the action that triggers it, not the table the action was performed on.
Another item to note is that certain things that require triggers and sequences in one RDBMS (Oracle) can be done with a set of keywords in another (MySQL). I'm speaking of the AUTO_INCREMENT keyword in MySQL that can only be duplicated by using a trigger and a sequence in Oracle. The keyword may be implemented as such under the hood, but it also may not. Regardless, it's still syntactic sugar.
------
We are the carpenters and bricklayers of the Information Age.
Then there are Damian modules.... *sigh* ... that's not about being less-lazy -- that's about being on some really good drugs -- you know, there is no spoon. - flyingmoose
I shouldn't have to say this, but any code, unless otherwise stated, is untested
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^3: OO concepts and relational databases
by adrianh (Chancellor) on Aug 02, 2004 at 20:46 UTC | |
by dragonchild (Archbishop) on Aug 03, 2004 at 02:39 UTC | |
by adrianh (Chancellor) on Aug 03, 2004 at 09:00 UTC | |
by dragonchild (Archbishop) on Aug 03, 2004 at 12:49 UTC | |
by adrianh (Chancellor) on Aug 03, 2004 at 14:13 UTC | |
by Solo (Deacon) on Aug 03, 2004 at 11:43 UTC |