Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Referential integrity which tier?
Message
From
24/11/1999 17:31:20
 
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00288250
Message ID:
00295364
Views:
30
OK....here's what I mean: You have a table of addresses for customers. There must be at least one address per customer (1:1+). You enter a new customer and forget to enter an address. You save. Business tier returns error code; it never gets to the data.

You go to delete a customer with 3 addresses. Business tier passes this on to the data tier (or to a stored proc in the database) which deletes the addresses and then the customer within a transaction.

So....

Can I add a customer? Biz rule with RI rule
Can I delete? Biz rule.
What do I delete? RI rule.


>Not sure if I follow.
>
>The main point is that VFP mixes different things using the same technology. There are 1:n relations which are plain technical issues (simply the fact that a customers phone numbers have to be in a separate tables as VFPs tables don't have "collection" fields is one example). There are other 1:n relations that are business issues. A customer with many invoices for instance.
>
>Invoices and customers are two different business entities. Phone numbers belong to customers just like the customer's name. Therefore phone numbers and customers are one entity.
>
>Relations between entities need to be enforced by the business logic. Relationships within one entity are technical issues (that typically only occur in relational systems). Therefore, they need to be handled in the data tier, so we can swap the data tier our easily.
>
>Markus
------------------------------------------------
John Koziol, ex-MVP, ex-MS, ex-FoxTeam. Just call me "X"
"When the going gets weird, the weird turn pro" - Hunter Thompson (Gonzo) RIP 2/19/05
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform