Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Who's in charge??
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
The Mere Mortals Framework
Titre:
Who's in charge??
Divers
Thread ID:
00255006
Message ID:
00255006
Vues:
61
I'm working on a bit of code that will involve two different bizobjs and I'm looking for suggestions on how to design the interaction (I can make it work, but I'd like to make it as "elegant" as possible).

Here's the scenario:

-Each invoice can have it's own set of rates.
-When a new invoice is create I copy the rates from a "master" table into an "InvoiceRates" table
-Each line in the invoice is linked to a record in the "InvoiceRates" table
-I have an object called LineRatesObj
-- This object has an AddRates() / DeleteRates() method that copies (from the "master")/deletes rates in the "InvoiceRates" table
- I have an InvoiceLinesObj

At some point, the user can decide to change the rates for the invoice. This would mean I'd have to AddRates() to the InvoiceRates table, DeleteRates() for the old set of rates, then relink the invoice lines to the new rates.

Which object should be resposible for this? Should I add a ChangeRates() method to my InvoiceLinesObj, then in there create an instance of LinesRatesObj and access it's methods (or do this in InvoiceLinesObj instead)? Either way seems "wrong" (although functional).

Is this a place where I should use an Event?
-Paul

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

Click here to load this message in the networking platform