Re: Referential Integrity
Both :) Todd Ashworth -- Web Application Developer Network Administrator Saber Corporation 314 Oakland Ave. Rock Hill, SC 29730 (803) 327-0137 [111] - Original Message - From: "Cyrill Vatomsky" [EMAIL PROTECTED] To: "CF-Talk" [EMAIL PROTECTED] Sent: Thursday, February 22, 2001 2:48 PM Subject: Referential Integrity | HI, | | My question is whether it is better to write CF routines to maintain | referential integrity of the database (say, hiding a delete button or | checkbox if child records exist in another table) or to set up "Preserve | Referential Integrity" rules in MS access and try to catch errors? | | Which leads me to a theoretical question: should I rely more on built-in | database functions or on CF? | | Thanks, | | Cyrill ~~ Structure your ColdFusion code with Fusebox. Get the official book at http://www.fusionauthority.com/bkinfo.cfm Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists
Re: Referential Integrity
I will be out of the office today, Monday, February 26. I will return Tuesday, February 27. ~~ Structure your ColdFusion code with Fusebox. Get the official book at http://www.fusionauthority.com/bkinfo.cfm Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists
RE: Referential Integrity
Cyrill, I think everyone will advise you to always prefer the database functions--especially when dealing with referential integrity. Databases have had almost 40 years with some of the best minds applied to them. They're stable, elegant and fast. Hal Helms == See ColdFusionTraining.com for info on "Best Practices with ColdFusion Fusebox" training == -Original Message- From: Cyrill Vatomsky [mailto:[EMAIL PROTECTED]] Sent: Thursday, February 22, 2001 2:49 PM To: CF-Talk Subject: Referential Integrity HI, My question is whether it is better to write CF routines to maintain referential integrity of the database (say, hiding a delete button or checkbox if child records exist in another table) or to set up "Preserve Referential Integrity" rules in MS access and try to catch errors? Which leads me to a theoretical question: should I rely more on built-in database functions or on CF? Thanks, Cyrill ~~ Structure your ColdFusion code with Fusebox. Get the official book at http://www.fusionauthority.com/bkinfo.cfm Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists
Re: Referential Integrity
In a performance tips seminar that Ben Forta gave, he said that referential integrity was best left in the database rather than coding it yourself. Then use CF to catch the errors. Having said that, for deletes, I still check to see if children exist!!! From: "Cyrill Vatomsky" [EMAIL PROTECTED] Reply-To: [EMAIL PROTECTED] Date: Thu, 22 Feb 2001 11:48:57 -0800 To: CF-Talk [EMAIL PROTECTED] Subject: Referential Integrity HI, My question is whether it is better to write CF routines to maintain referential integrity of the database (say, hiding a delete button or checkbox if child records exist in another table) or to set up "Preserve Referential Integrity" rules in MS access and try to catch errors? Which leads me to a theoretical question: should I rely more on built-in database functions or on CF? Thanks, Cyrill ~~ Structure your ColdFusion code with Fusebox. Get the official book at http://www.fusionauthority.com/bkinfo.cfm Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists
RE: Referential Integrity
My question is whether it is better to write CF routines to maintain referential integrity of the database (say, hiding a delete button or checkbox if child records exist in another table) or to set up "Preserve Referential Integrity" rules in MS access and try to catch errors? Which leads me to a theoretical question: should I rely more on built-in database functions or on CF? I love theoretical questions. In my opinion, you should always, ALWAYS, use declarative referential integrity rules in your database. You shouldn't rely on your application to maintain database integrity. DRI should be incorporated into the database design process - when you're deciding what your entities and relationships will be, you should also decide how RI will work. That said, it's also my opinion that you should code your application as if you didn't use DRI. Your application shouldn't do things that would cause integrity problems in the absence of DRI within the database. There's nothing wrong with a little redundancy here. You can make this relatively easy by using stored procedures within the database to handle things like the deletion of child records before their parents. Dave Watts, CTO, Fig Leaf Software http://www.figleaf.com/ voice: (202) 797-5496 fax: (202) 797-5444 ~~ Structure your ColdFusion code with Fusebox. Get the official book at http://www.fusionauthority.com/bkinfo.cfm Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists
Re: Referential Integrity
This is only my opinion... it all depends on your take. Sometimes it is much easier to put a constraint on your database rather than have to check for the constraint violation a million of times in your CF code. However, this forces you to use try/catch blocks, which you really should be using in the first place. From my experience, I've found that trying to catch constraint violations that have not been set at the database level to be messy and sometimes inefficient (involving other queries, etc.). - Original Message - From: "Cyrill Vatomsky" [EMAIL PROTECTED] To: "CF-Talk" [EMAIL PROTECTED] Sent: Thursday, February 22, 2001 12:48 PM Subject: Referential Integrity HI, My question is whether it is better to write CF routines to maintain referential integrity of the database (say, hiding a delete button or checkbox if child records exist in another table) or to set up "Preserve Referential Integrity" rules in MS access and try to catch errors? Which leads me to a theoretical question: should I rely more on built-in database functions or on CF? Thanks, Cyrill ~~ Structure your ColdFusion code with Fusebox. Get the official book at http://www.fusionauthority.com/bkinfo.cfm Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists
RE: Referential Integrity
It's probably best to do both: Check in CF for things that are most likely to break, but always build your referential integrity into the DB in case something gets past your code (and then catch handle, of course!) When you're dealing with forms, you can also add client-side validation. Not that I've always operated this way ;( Eric -Original Message- From: Cyrill Vatomsky [mailto:[EMAIL PROTECTED]] Sent: Thursday, February 22, 2001 11:49 AM To: CF-Talk Subject: Referential Integrity HI, My question is whether it is better to write CF routines to maintain referential integrity of the database (say, hiding a delete button or checkbox if child records exist in another table) or to set up "Preserve Referential Integrity" rules in MS access and try to catch errors? Which leads me to a theoretical question: should I rely more on built-in database functions or on CF? Thanks, Cyrill ~~ Structure your ColdFusion code with Fusebox. Get the official book at http://www.fusionauthority.com/bkinfo.cfm Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists
Re: Referential Integrity
Another reason to handle it in the database: If you do it in your app, you've got to do it in every app that accesses the database. If you do it in the database, it's a one-shot deal. Always try to operate as close to the data as possible. -David On Thu, 22 Feb 2001 16:50:59 -0500 "Hal Helms" [EMAIL PROTECTED] writes: Cyrill, I think everyone will advise you to always prefer the database functions--especially when dealing with referential integrity. Databases have had almost 40 years with some of the best minds applied to them. They're stable, elegant and fast. Hal Helms -Original Message- From: Cyrill Vatomsky [mailto:[EMAIL PROTECTED]] Sent: Thursday, February 22, 2001 2:49 PM To: CF-Talk Subject: Referential Integrity HI, My question is whether it is better to write CF routines to maintain referential integrity of the database or to set up "Preserve Referential Integrity" rules in MS Access and try to catch errors? ~~ Structure your ColdFusion code with Fusebox. Get the official book at http://www.fusionauthority.com/bkinfo.cfm Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists