CSLA .NET

From Rockford Lhotka's Expert C# 2005 and VB 2005 Business Objects books

Welcome to CSLA .NET Sign in | Join | Help
in Search

Need flexible rules pattern

Last post 08-25-2008, 9:31 AM by bgilbert. 0 replies.
Sort Posts: Previous Next
  •  08-25-2008, 9:31 AM 25713

    Need flexible rules pattern

    I have two tables with associated classes that represent defect codes and disposition codes. Each table has a boolean column called RequiresApproval. If this is set to true, the user needs a supervisor's approval to use this defect or disposition code.

    My client now wants a rule that allows a RequiresApproval flag on combinations of Defect Codes and Disposition Codes. So, defect code A might not require approval and disposition code B might not, but the combination would. Our first thought was to have an association table that stores the two codes' keys and a boolean field. We would then write some code to evaluate this combination, perhaps in a DefectDisposition object. This brought up a broader question. What if the client asks for the rules to get more complex, involving other tables or columns? Do we continue to add association tables, classes, etc?

    In light of this, we've been discussing an Approval class that could somehow manage any combinations of rules from any entities. This, however, still doesn't answer the question of how to store the rules, how to allow the client to maintain the rules, and how to evaluate them.

    Any help/ideas would be appreciated.

    Barry
View as RSS news feed in XML

Please contact Magenic for your .NET consulting and CSLA .NET mentoring needs.
Please consider making a donation to help support the ongoing development of CSLA .NET.

Make donation through PayPal - it's fast, free and secure!
Why donate?
Powered by Community Server, by Telligent Systems