Re: The fable of DEMETRIUS, CONSTRAINTICUS, and AUTOMATICUS
Date: Tue, 19 Oct 2004 15:35:40 -0400
Message-ID: <daq3lc.rh8.ln_at_mercury.downsfam.net>
Tony Andrews wrote:
>> I have just made a post where I show how to handle all of Tony's
> examples
>> structurally. Can you think of any that are even tougher? I would
> be
>> happy for the exercise in finding the limits of my hypothesis.
>
> How about this kind of real example from my memory of a timesheet
> system I once worked on.
>
> create table emp (empno primary key, ...)
>
> create table project (projno primary key, ...)
>
> create table emp_proj_assignment (empno references emp,
> start_date, end_date, projno references project,
> billable_flag varchar2(1) check (billable_flag in ('Y','N')
> primary key (empno, start_date));
>
> create table task (taskno primary key,
> billable_flag varchar2(1) check (billable_flag in ('Y','N'));
>
> create table timesheet_line
> (empno references emp,
> ts_date date,
> taskno references task
> hours, ...);
>
> The complex rule is:
> An employee may only book time (via a timesheet_line) to a task on a
> project to which the employee is assigned on ts_date, and where the
> billable_flag on the emp_proj_assignment matches that of the task.
> (The trouble with complex rule examples is they are so, well, complex!)
Well, as long as we are going by memory and experience, here is mine:
(drumroll......)
Constraints such as these are always abandoned in real life. A cowboy
manager grabs Employee X and says, "you work on this now, because a) we'll
make a bag of money quick or b) they'll sue us if we don't." The user then
does the work. He then goes to the manager and says, "I can't enter my
time, what should I do?" The manager tells him how to enter some bogus
information so everyone can get back to work. If billing is affected,
somebody gets on the blower to IT and says, "Get that damn constraint out
of the system, I've got to enter billable time!!"
If the IT guy is looking to retire, he'll reply, "Oh, I can't do that,
company policy is...." If he likes his job he'll say, "I'll put my best
guy on it right now."
-- Kenneth Downs Use first initial plus last name at last name plus literal "fam.net" to email meReceived on Tue Oct 19 2004 - 21:35:40 CEST