Re: Enforcing Business Rules

From: Mike Briggs <mikeb_at_probes.com>
Date: 2000/02/02
Message-ID: <389881EF.AF1B05A_at_probes.com>#1/1


I have to toss my two bits in with Mr. Wilson. I am perfectly happy adding triggers etc to tables to enforce business logic, and it's almost certainly marginally faster to handle it at that level. However, maintianing numerous applications, I usually can't remember the names of the tables involved, let alone what silly rules, restrictions and triggers I embedded in them when they were built. Trying to ferret this information out of anything other than a trivial application can be very time consuming, frustrating, and just plain boring.
If I move all the business logic into the application, it is all located in a central location, is VERY easy to modify, and I can clearly comment and document anthing I think I'll need to be reminded of later. Now, it's possible that most of you have much better memories than I do. Or maybe you've never had the joy of coming into an application designed with the business logic scattered over 20+ data tables with no documentation. Once you try this, it makes future decisions much easier!

P.S. I will make exceptions in the case of trivial databases, particularly if the "Application" is something with really poor connectivity/management like ASP. If the app can't handle it, and the logic is simple, THEN bury in the database!!!

Peter Wilson wrote:

> The key to your answer, really lies in the future of the project. You are
> currently working on version 1? How will the programmers accommodate changes
> once you and your customers require structural / logical changes for version
> 2.
>
> Version 2 will required more complex relationships using existing tables.
> The database may grow to an astronomical size. The number of users may
> increase 1000 fold (is this app going to be run on the Internet
> eventually.... in the long run?)
>
> Will putting code in the database provide for version 2, or is code better
> off being placed into DLLs and run under Microsoft's Transaction Server?
> Will the database be used to support both version 1 of an application and
> also version 2 of the same application, or will everyone have to upgrade
> immediately to version 2 to start using the new database? Once you upgrade
> to version 2 and it's not suitable, and you're faced with a re-write, then
> what?
>
> I personally never put rules into the database.
>
> That's my 2 cents worth...
>
> --
> Pete
>
> Barnel Saintilma <bt974_at_ncf.ca> wrote in message
> news:38937789.3704C58E_at_ncf.ca...
Received on Wed Feb 02 2000 - 00:00:00 CET

Original text of this message