Saturday, October 20, 2007

Thoughts on Laurent Ribardière's Comment on Using Triggers in 4D

In the general Q&A session at the Summit this year Laurent Ribardière recommended that developers not use triggers, or if they must use triggers, that they use them as sparingly as possible. As soon as I heard the statement I worried about the next big wave of bad 4D programming - with 4D developers not using triggers when they really should be using them.

I had a talk about it over breakfast (or lunch?) the next day with David Adams, who we all know loves to talk about triggers. He was in agreement... Sure - keep your triggers light and efficient, but triggers are there for a purpose - they enforce data integrity, and data integrity is a good thing - a really good thing.

Data integrity is an even bigger issue with v11 than it was with previous versions since you can have SQL calls hitting your database which you don't have control over because they don't go through your 4D source code. Triggers are more important now than ever.

Bottom line let Laurent and others worry about the performance penalties of using triggers. And yes, be careful about what you put in triggers. If performance of a particular table is a big issue, consider carefully ditching the trigger on the table. But only do it as a last resort...

Labels: , ,

Digg It!  Add to del.icio.us  Add to StumbleUpon  Add to Reddit  Add to Technorati  Add to Furl  Add to Netscape

0 Comments:

Post a Comment

Links to this post:

Create a Link

<< Home