Re: Declaring Unenforced Constraints

From: Kenneth Downs <firstinit.lastname_at_lastnameplusfam.net>
Date: Mon, 08 Nov 2004 10:03:54 -0500
Message-ID: <qfe462-mqv.ln1_at_pluto.downsfam.net>


Laconic2 wrote:

>

>> 1.  unique
>> 2.  referential
>> 3.  column comparison (column a <= column b)
>> 4.  lookup comparison (column a <= UDF_GetSysVar("some_parameter"))

>
> Add one more: range limitation.

>>

I was going to, but I believe that it is the same beast as 3. and 4. above, but as commonly implemented would be a "constant comparison." I cannot bring myself to bury constants in any kind of code, not even column definitions, so I would want to use 4. above for any range comparisons. (or if it salary of course we use that lookup table (ducking)).

>

>> For unique tendencies, it seems that you can only allow 100% confidence
>> in
>> uniqueness tendencies.  Am not sure what a partially enforced constraint
>> would do here.  Do you have any examples of semi-unique entities?

>
> Sure, first name and last name among students. If you know the first name
> and the last name (including spelling), but you don't know the student ID,
> the user interface should let you take a shot at it, or shouldn't it?
>
>

I'm guessing that you would not have the UI be the final arbiter of the business rules, so we would not discuss constraints in the context of the UI. In an extreme separation of client and server, the UI takes whatever you type and gives it to the server, and reports errors. In the more user-friendly model you and I seem to favor, the UI would prevent as many unnecessary round trips as possible by checking for whatever it could, but this would not be considered enforcement, merely assistance.

Therefore, we would not discuss the ultimate definition and enforcement of a constraint in the context of what the UI is doing, would we? The constraint is 100% enforced, but the UI's job is to let you try.

-- 
Kenneth Downs
Use first initial plus last name at last name plus literal "fam.net" to
email me
Received on Mon Nov 08 2004 - 16:03:54 CET

Original text of this message