Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Design question - should this be a child?
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
The Mere Mortals Framework
Titre:
Design question - should this be a child?
Divers
Thread ID:
00187538
Message ID:
00187538
Vues:
56
I am working on an application that is using the cbizmaintenanceform as the base for one of the screens. One the second page of the form, I have a group a fields used to fill our customers name/address information. My primary business object uses a table that stores all of this information (as well as a lot more)(estimateobj). I also have a business object that deals only with a “customers” table (customersobj). The idea behind this is that when they are entering the information they can click on a Find button to look up a previous customer (via customersobj). Since it is possible that the customers address may change, I also store this information through the estimateobj.

Would the customersobj be considered a child object of the estimateobj? Before saving any customer information, I’d like my customersobj to check to make sure the customer name doesn’t already exist. If it does, set a flag to let my application know that a duplicate might exist (and to prompt the user to ask them what they’d like to do – add a new customer record or replace the existing customer’s info). I guess maybe the real question I’m asking is, what order is the Save() method of my parent/children objects called? Parent first, then children? Since the controls on the form will probably be bound to the primary view of estimateobj, at some point I need to pass this information to my customersobj so it can either save or flag it for my app to display a prompt. If I place my code in the PreSaveHook() of the estimateobj I would have to make the assumption that the primary Save() method is called first; if it isn’t, the my code in PreSaveHook would fail.

The next question would be, at what point in my application should I check the flag put up by the customersobj? I guess by the time it reaches the PreSaveHook() it might be too late (since I don’t want to mix in form code in my business object).

Any ideas on how I should approach this?

Thanks,
-Paul

RCS Solutions, Inc.
Blog
Twitter
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform