Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Subclassing BizRules and Using A View
Message
From
02/05/2002 19:07:34
 
 
To
02/05/2002 17:04:58
General information
Forum:
Visual FoxPro
Category:
The Mere Mortals Framework
Miscellaneous
Thread ID:
00652136
Message ID:
00652175
Views:
15
>I have a group of business objects which access a group of similar tables.
>
>All of these objects share some fundamental business rules - for example, no records can be created prior to a certain date.
>
>My initial approach to solving this was to create a subclass of kBizRules, called DEBITRULES, and create a common set of business rules for this class. I would then subclass debitrules for each of the business objects, so I could apply more specific rules to each object.
>
>The issue is I need to access a view to check the common rules. The view is the same for each object. How can I do this without adding the view to each of the business objects which will be using this debitrules subclass? If I do that, then every time I add a new view to check a rule, I'll need to add it to each business rule's data environment.
>
>Or, perhaps there is an alternative way for a bunch of business objects to share common rules (which require lookups in views).

Given a program that works with the US Gov't and its penchant for rewriting rules every year, I'm working on something similar.

I subclassed the kBizRules object, giving it its own aBizRules bizobj. It has views of RuleSet and BizRules to mix, match, and re-use rules where appropriate. Right now, I can switch between having the goApp object create Bizrules to cut down overhead (Private datasessions beware!), or have the aBizRules object instantiate its own when rules are questioned.

Actual rule code can be macro &executed or execscript()ed.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform