I’m working on an n-tier application that needs a rules engine on the presentation end.
I need to load display rules from a DB into the BLL tier and pass them onto the client. E.g. Item A is outlined in red when propertyX is true, outlined in white when propertyY is true && It should be hidden when neither is true and you do not have the Admin role
The BLL will end up being rules driven at some point, but we will be migrating hard coded logic from the existing client/server app there first.
Looking at WF, it appears to allow me to create and serialise workflows that I can host on the BLL or on the presentation layer.
I expect there to be a large number of rules as different user roles will get slightly different sets of rules for the 50 odd types of entity exposed to the presentation layer.
Is this a good idea?
Would it be simpler to define a DSL and manage everything myself?
Actually I think that Workflow would be a good fit for this scenario. There are many people who build applications where workflows execute client side and we have good support for this with WorkflowApplication which supports workflows on background threads.
In fact, I wrote the Introduction To State Machine Hands on Lab with this very scenario. In that application a WPF client with the MVVM pattern uses a Workflow in the model to control the behavior of a simulated ATM machine.