Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Business Rules
Message
 
To
03/09/2003 19:45:57
General information
Forum:
ASP.NET
Category:
The Mere Mortals .NET Framework
Title:
Miscellaneous
Thread ID:
00825867
Message ID:
00826052
Views:
22
I haven't actually used an mmBusinessRule yet, but the documentation discusses calling just before saving the data. I have had many situations where certain valid data is required in one control before the user can go on to the next control. (In VFP I call code from the Valid or LostFocus of a control.) I am not picturing how an individual rule is invoked from the user interface. I imagine that the control raises some sort of DataChanged event which is trapped by the bizobj. Can someone point me toward an example of how that would be done in MM?

Pamela, There's nothing wrong with placing the business logic in the UI and the BizRuleObj.

A lot of times what we've done is put most of the business logic in the BizRuleObj in preparation for the web and access the business logic in the BizRuleObj from the UI in order to avoid having to put code in the both places.

Puting code in the UI is just another layer of defense that will ensure the integrity of your data.

One method that we've used is to create a wrapper method on the BizObj that corresponds to a method or a number of methods in the BizRuleObj. Say for example you have an order entry form that allows the user to enter their name, address, phone, etc...

You can probably call one method on the BizObj that calls several methods on the BizRuleObj. BizObj.ValidateAddress() calls BizObj.oBizRules.ValidateStreet(), BizObj.oBizRules.ValidateState(), BizObj.oBizRules.ValidateZipCode... so on and so forth.

Hope this helps!
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform