> 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/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists