Walter Meester
HoogkarspelNetherlands
General information
Category:
The Mere Mortals .NET Framework
Environment versions
Network:
Windows 2008 Server
Hi Ron,
I cannot help you on the .NET specifics, but the strategy I've used in our VFP application could be used in .NET as well. We have an Expression validation class and each individual rule is a subclass of that. We store the rules into a chain of responsibility (but you could do this in a collections as well) at run time. A validation method on the CA (But could be Biz or data object as well) will be called for each rule in the chain (or collection).
We do compile the rules at runtime which in VFP is easier to do than in .NET, but if you do not need to add ad-hoc business/validation rules, compiling them beforehand might work for you.
We have moved away from using EVALuating rules because it is slower than compiled rules. The difference was significant enough to go for compiles rules.
Walter,
>Hello Everyone.
>
>I have all my syntax expressions in a sql table. I was wanting to write a method in NET that would get those expressions from SQL Table and evaluate the expressions via True or False. For example, BusinessObject.Field > 1 is an example of the expression in the table. i what to check the expression and store the result value of true or false.
>
>Do any have any code snippet that i can use. I am trying to create a generic method that would traverse through expressions in a sql table and evaluate them.
Previous
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only