Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: You have my sympathies

Re: You have my sympathies

From: Jonathan Lewis <jonathan_at_jlcomp.demon.co.uk>
Date: 2000/03/15
Message-ID: <953148236.29345.0.nnrp-08.9e984b29@news.demon.co.uk>#1/1

Still taking the position of the devil's advocate here - this bit of 'data integrity' is not an inherent requirement of the data when viewed from the perspective of the database

Arguably the purpose of the database is to ensure that if I put in 1 customer and 5 orders they all go in or nothing goes in, and if I join two tables on a given column then the
results appear as expected.

The fact that the business layer will only allow orders to go in if a related customer exists is not a piece of information that the database needs to know.

(And, of course, if the only code to insert and delete data comes from the business
layer, (as it no doubt will ;) then the business rules about customers will say that a
customer may only be removed from the
business if they have placed no orders.
So the database does not need to
duplicate the code built in to the
business layer).

--

Jonathan Lewis
Yet another Oracle-related web site:  http://www.jlcomp.demon.co.uk

Nuno Souto wrote in message <38cf446d.3089705_at_news-server>...

>On Wed, 15 Mar 2000 07:41:38 -0000, "Jonathan Lewis"
><jonathan_at_jlcomp.demon.co.uk> wrote:
>
>>
>>Now, the fact that an order can only be
>>placed by an existing customer is a
>>business rule, is the responsibility
>>of the middle tier.
>
>You forgot one very important element. Mentioned it at the beginning,
>but then got lost. Data Integrity. It belongs in the database
>server, not in the application server.
>
>The business rule says: an order must be placed by an existing
>customer. It probably also says that an order is made up of a number
>of steps and elements. Fine. Put the data integrity bit where it
>belongs and code the fiddly "elements and steps" in the application.
>
Received on Wed Mar 15 2000 - 00:00:00 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US