Re: Performance considerations

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance

From: William Ryan eMVP (bill_at_NoSp4m.devbuzz.com)
Date: 03/04/04


Date: Thu, 4 Mar 2004 02:37:10 -0500

Depends on how important data integrity is to you. There's no excuse for
not having constraints on the backend b/c your app is not the only way that
data can get entered and your asking for disaster if you don't have the DB
enforce it's own integrity. (I know there are a lot of people that will say
that this isn't the case, that they will never have users access the DB with
anything but their app etc...but even if that's the case, you'll have to
write a Whole lot of extra code and if by any chance anyone ever gets
visual tools for the db or another program is written, you'll probably
encounter some serious drama).

On the other hand, client side validation is important too, if for no other
reason than User experience. If you go with only backend Validation, users
may enter junk into your app, only to have the DB reject it---they'll get
some lovely MessageBox barking at them and they'll get annoyed quickly. So,
features like disabling things that users shouldn't do or preventing them
from continuing if invalid data is entered is pretty important..not so much
for performance as user experience, but performance wise it's a waste to
send data that you know won't conform to the DB only to have it tell you
it's junk.

Hence, a combination of validation with all of the necessary constraints on
the backend will allow your app to scale and you won't have to worry about
coding around every possible secnario of user errors. On the ADO.NEt side,
providing adequate constraints there can enforce your validation logic
before it ever has to go back to the db. This uses some additional
resources locally, but it saves network and database resources. ADO.NET
constraints wedded with UI (like disabling the Ok button until all the
required fields are entered and putting an asterisk or some other identifier
next to all labels on required fields) validation (you have a ton of UI
events for any given control particularly validating to accomplish this.

In short, I think validation at all levels is necessary if you want an app
that is bullet proof and won't break when any modifications are done.

HTH,

Bill
"A" <anonymous@discussions.microsoft.com> wrote in message
news:31D7723B-FA3F-4DE4-B871-FD298856540E@microsoft.com...
> Hi all!
>
> I am currently designing a program that uses the ado.net.
>
> I have a question...
>
> Which is better? To have your data constraints implemented on the dataset
or constraints on the database? Or both?
>
> Thanks a million!
>
> A
>
>
>



Relevant Pages

  • Re: Relationships. Does anyone use them?
    ... more overhead in creating an app and unnecessary...or do you believe ... One of the basic precepts of relational database design is to have the ... generally called constraints - I believe that is the term used in the ... What do I care if I didn't go in into the relationships window to set the relationship....for the most part its always done for me. ...
    (comp.databases.ms-access)
  • Re: candidate keys in abstract parent relations
    ... To what extent do we defend the validity of the data in the database, for instance an email address, in SQL Server you can now create a column say is_valid_email which can call a CLR scalar function that can run a bit of C# / VB.NET to actually go out and validate if that email address is truely valid at the point you want it... ... I'll be interested to see how they develop this further, like how all the usual relational ops will behave on that CLR column, eg. how does one compare two such programs to see if they are somehow 'equal'? ... Can't resist - I suppose in some cases a lot of disk space could be saved if each app had its own validation code. ...
    (comp.databases.theory)
  • Re: Relationships. Does anyone use them?
    ... more overhead in creating an app and unnecessary...or do you believe ... One of the basic precepts of relational database design is to have the ... generally called constraints - I believe that is the term used in the ... One important constraint is what in Oracle is called the foreign key ...
    (comp.databases.ms-access)
  • Re: Validation of text
    ... If you are saying that designing effective database constraints is hard ... should) write form-level validation *and* database level ... you used the Validation Rule property of the fields in your table, ...
    (microsoft.public.access.forms)
  • Re: Validation of text
    ... If you are saying that designing effective database constraints is hard ... Consider that if you have no database level constraints then your data ... should) write form-level validation *and* database level ...
    (microsoft.public.access.forms)