![]() | |
![]() |
| | Thread Tools | Display Modes |
#11
| |||
| |||
|
|
On May 13, 12:54*pm, Tom Anderson <t... (AT) urchin (DOT) earth.li> wrote: [] I don't understand either of those concepts - either the idea that changes to the database might not preserve entities and relationships, or E-R creep. Could you give me some examples? sure 1 - *changes to the database might not preserve entities and relationships Ok, if you have 2 entities joined by a primary-key foreign key relationship and if you can never add a row to one table without a related row in the other, and if there is only an advertised stored proc which does the INSERT in a transaction to both tables, then the preservation across tables is guaranteed. If developer code can write to the database, then one table might be written to without the other. |
|
2 - Entity-relationship creep: here's a good example. You pull 100 rows from a customer table. And then you write a loop in your program code, skipping over customers based on a series of if-thens, and then do something with the remaining customers... basically what has happened is that you were looking for some subset of the customers, but did not specify that subset with a well-defined and business- documented label. Instead you created a sub-entity of customers on the fly with no documentation for that sub-entity. |
| To be honest, my visceral reaction is that you are exactly the kind of nutjob DBA who makes actually developing software a nightmare. However,i am conscious that this is my guts talking, not my brain. metaperl (me) is a Perl programmer ---http://www.metaperl.org It's just I worked at oracle, which is where I learned the "read any way you feel, updates are only via stored procedures that I look over before they get added to the db" |
#12
| |||
| |||
|
|
On May 13, 12:54*pm, Tom Anderson <t... (AT) urchin (DOT) earth.li> wrote: On Thu, 13 May 2010, metaperl wrote: Instead, all updates and deletions are provided to the developer via stored procedures. The motivation for controlling insert/update/delete is to ensure that all changes to the database preserve entities and relationships. It also prevents developers from "E-R Creep" --- that is, it prevents developers from fattening their controllers and views with implicit entities and relations that they identify and build in program code in an unstructured, undocumented fashion. I don't understand either of those concepts - either the idea that changes to the database might not preserve entities and relationships, or E-R creep. Could you give me some examples? sure 1 - changes to the database might not preserve entities and relationships Ok, if you have 2 entities joined by a primary-key foreign key relationship and if you can never add a row to one table without a related row in the other, and if there is only an advertised stored proc which does the INSERT in a transaction to both tables, then the preservation across tables is guaranteed. If developer code can write to the database, then one table might be written to without the other. |
|
2 - Entity-relationship creep: here's a good example. You pull 100 rows from a customer table. And then you write a loop in your program code, skipping over customers based on a series of if-thens, and then do something with the remaining customers... basically what has happened is that you were looking for some subset of the customers, but did not specify that subset with a well-defined and business- documented label. Instead you created a sub-entity of customers on the fly with no documentation for that sub-entity. |
![]() |
| Thread Tools | |
| Display Modes | |
| |