Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Business Rules Question
Message
De
29/05/2003 12:52:56
Joel Leach
Memorial Business Systems, Inc.
Tennessie, États-Unis
 
 
À
29/05/2003 11:15:37
Information générale
Forum:
Visual FoxPro
Catégorie:
Programmation Orientée Object
Divers
Thread ID:
00793957
Message ID:
00794015
Vues:
35
This message has been marked as the solution to the initial question of the thread.
Hi Kevin,

>
>I have a business rule which on validation has to check data that belongs to another business object.
>
>Is it OK to use other business objects within business rules in order to check validity?
>
>Example: (business rule code)
>
>
>*Check if customer has any outstanding invoices
>loRecordset = this.oInvoiceBizOBj.GetOpenInvoicesByCustomerID(tnId) && Access Invoice BizObj
>
>*blah blah
>.....etc.etc.
>
>
>Is that good practice? or bad?
>

IMO, this is a good practice. You are delegating the task of retrieving the data to the appropriate object. I'm not sure how much more code is involved, but if you find yourself repeating it, you might consider moving the entire validation to oInvoiceBizObj, but only if it makes sense. As it stands, I think you have a pretty good design here.
Joel Leach
Microsoft Certified Professional
Blog: http://www.joelleach.net
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform