Re: Arbitrary Constraints
From: Kenneth Downs <firstinit.lastname_at_lastnameplusfam.net>
Date: Tue, 26 Oct 2004 12:47:59 -0400
Message-ID: <34vllc.fo4.ln_at_mercury.downsfam.net>
> because I
> with RI,
> not
> so
>
> A lot of constraints I come across in my working life concern dates.
> In previous discussions you were quite dismissive of date-related
> constraints, saying they reflect bad design: history tables should be
> maintained automatically etc. But consider a hotel reservations
> system, where a new room booking must not overlap another booking for
> the same room. That isn't history, that's the future!
Date: Tue, 26 Oct 2004 12:47:59 -0400
Message-ID: <34vllc.fo4.ln_at_mercury.downsfam.net>
Tony Andrews wrote:
>> This may be a can of worms in asking for more constraint examples,
> because I
>> may have to fend off a lot of constraints that could be dealt with
> with RI,
>> but what I think I'm looking for are the very simple cases that are
> not
>> obviously structural, like simple credit limits, inventory >= 0 and
> so
>> forth.
>
> A lot of constraints I come across in my working life concern dates.
> In previous discussions you were quite dismissive of date-related
> constraints, saying they reflect bad design: history tables should be
> maintained automatically etc. But consider a hotel reservations
> system, where a new room booking must not overlap another booking for
> the same room. That isn't history, that's the future!
I did not dismiss your examples, I offered my own solutions, which proceed (apparently) from a different set of assumptions than yours.
As for scheduling, your experience agrees with mine, that this is a different kind of problem from the other two. Do you have in the schedule table a unique key on room + date? Do you have the concept of a fixed time period, such as March 25th means March 25th after 3:00pm until March 26th before 11:00am? If so, how can anybody overlap if you are unique on room + date?
-- Kenneth Downs Use first initial plus last name at last name plus literal "fam.net" to email meReceived on Tue Oct 26 2004 - 18:47:59 CEST