DSL: from DSL rules into C# expressions?

You could build something like this your self.

You could build something like this your self. You can get a list of all the public properties for a class using Type.GetMembers() However, instead of generating C# code, I would use expression trees. That way you don't need to involve the C# compiler when the users change rules.

Instead, you can store the rules in a database, load them at runtime, and then use the Expression.Compile() method to create a delegate you can invoke to run the code. Update: In the comments someone asked "What is the difference between Expression Tress and domain specific languages? " Here's the answer: Expression trees and domain specific languages are orthogonal things.

Expression tress are just an API for representing C# expressions, that conveniently can be converted into a delegate dynamically at runtime. A DSL, or domain specific language, is a programing language designed to solve a narrow class of problems. They are, essentially, completely different things.

You can use expression trees as part of a DSL implementation if you like. Linq uses them for for that purpose. In your case, however, you don't need a DSL.

What you need is a user interface that generates rules (similar to the way outlook works), and then a way of executing those rules. Creating the UI is just normal UI development. Expression trees are what you can use to implement the rules.

Our domain-object-tester application uses reflection to fill public properties and to create an instance of that objects, so thats okay. Expression tree sounds good - would you please give me some links about DSL vs. ET? Thank you – boj Jun 4 '09 at 13:10 I like this Expression Tree-based approach, thank you for the first shot.

– boj Jun 9 '09 at 10:12.

It's a little-known fact that the designer for Windows Workflow Foundation and its Rules Engine in particular can be hosted in a Windows Forms application separate from Visual Studio. The rules authored in this way can similarly be evaluated independent of an actual workflow. See WF Scenarios Guidance: Workflow Designer Re-Hosting and Tutorial: Hosting the WF Designer.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions