Re: Data independence

From: Paul <paul_at_test.com>
Date: Thu, 13 May 2004 23:52:43 +0100
Message-ID: <U_Soc.4046$NK4.343245_at_stones.force9.net>


x wrote:
>>>Would you ask somebody else to modify it for you ?
>>
>>No, you only have to modify the constraint in the database.
>
> Are you sure ?

If the application is written well, it will test the return value of every query it sends to the database. If it gets back a constraint violation message, it can pass that on to the user.

But suppose for example you have a table where the some two columns are defined to be the primary key. Your application displays a window with two fields for people to enter data.

Now you change the primary key to be some *three* columns. Or maybe two totally different columns. It then becomes impossible to use the application.

Or maybe a column is constrained to be greater than a certain value. The application does some sanity checking client-side that this is the case. Then you change the constraint to be *less than* that value (maybe having to update some existing data).

Really the only way you can get a totally flexible application is one than enables you to see the relations as they really are - either a GUI like "Enterprise Manager" for SQL Server for example, or a command line that enables you to write raw SQL. These kind of things can cope with constraint changes because they are querying the system tables and dynamically building the forms of the application.

Paul. Received on Fri May 14 2004 - 00:52:43 CEST

Original text of this message