Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Handling 1:M:M with views
Message
From
06/02/1999 21:01:29
Kenneth Downs
Secure Data Software, Inc.
New York, United States
 
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00184085
Message ID:
00184771
Views:
27
Rich,

>> it would make more sense to the user (and to me now that Bob mentioned it) to force saving any
parent before adding any children for it.<<

This was my first guess, but I think you run into problems.

First, if the user wants to revert a new record, you have to convert that to a delete in code. Not the worst thing in the world, but worse...

....is the possibility of saving invalid records, records that break business rules. Let's say you don't want a Sales Order saved without a sale amount. Well, you can't have a sales amount until you enter a line item.

You might then say, well, OK, I'll put some switches in there to bypass validation when line items are being added, but enforce it when the user himself excplicitly attempts to save the header. I had no choice but to do this with a commercial framework I use, but I hate the fact that invalid headers are in the base table. Power outages, etc., can lead to bad data in the tables.

It seems to me that if you accept the must-save-parent philosophy, you have to translate all business rules so that they don't conflict with this technical requirement.

>> (That includes saving 'children' before adding 'grandchildren'.) <<

It actually generalizes more than that. Given any n-level heirarchy where n is 4 or greater, the problem repeats itself for each 3-level subset of the heirarchy.

>> Interesting discussion, again, I'm glad we're having it.

I'm very glad we're having it <s>, I'm learning a lot.
Previous
Reply
Map
View

Click here to load this message in the networking platform