Re: Why all the max length constraints?

From: mAsterdam <mAsterdam_at_vrijdag.org>
Date: Sun, 28 May 2006 13:04:52 +0200
Message-ID: <44798303$0$31642$e4fe514c_at_news.xs4all.nl>


dawn wrote:
> Marshall wrote:

>>dawn wrote:
>>>[why all the length constraints?]

[snip]

>>Realistically, if you have a field for state/province, and someone
>>enters 6 megabytes of character data, something has gone wrong
>>somewhere.

>
> Yes, and there should be no data entry widget that permits entry of
> more than 2 characters for a state code, for example, more likely
> selecting from a drop-down.

If the state code fields (*) in the database are defined as having 2 characters, there is a efective max-length constraint of 2. Now it doesn't matter wether there is a data entry widget that permits entry of more than 2 characters for a state code. The data in the the database is garantueed to not violate this specific constraint.

Another constraint set/type (ISO country-codes) would be tighter, of course, and the user interface could well be more sophisticated by using them.

(*) Not phrased in RM terms to show that this is a general database issue, not RM specific.

>>Better to trap it around character 255 than to
>>let it just run along sucking up resources.

>
>
> I do want the software product (as a whole) to limit
> anything which has a conceptual limit.

This is a reason to put the conceptual limits as close to the data as possible. If they are enforced in the database the rest of the software product has to follow suit. Any other way isn't
garantueed, is it?

>>There is nothing specific to RM here.

[snip] Received on Sun May 28 2006 - 13:04:52 CEST

Original text of this message