Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Business Rules Question
Message
From
30/05/2003 06:50:15
 
 
To
29/05/2003 12:52:56
Joel Leach
Memorial Business Systems, Inc.
Tennessee, United States
General information
Forum:
Visual FoxPro
Category:
Object Oriented Programming
Miscellaneous
Thread ID:
00793957
Message ID:
00794424
Views:
27
>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.

Thanks Joel

I'm glad I've got it right.

Kev
Previous
Reply
Map
View

Click here to load this message in the networking platform