开发者

Basic rules engine architecture

We are currently developing a project in .NET that involves analyzing XML documents against a set of user defined rules. Here is an example:

<Person>
   <Name>Bob</Name>
   <Cars>
      <Car Type="SUV" Color="Black"/>
      <Car Type="Sports" Color="Red"/>
   <Cars/>
</Person>

EG rules: if person's name = "Bob" and has 2 cars then ... if person has as least one SUV and at least one Sports car then ...

We are going to build a "rule builder" wizard that walks the users through the process 开发者_如何学JAVAof creating a rule. In addition to this, one of the other complications is that the schema of the XML documents will be dependent on customer needs so we need a quick way to adapt to new schemas. Can anyone provide some insight into what underlying technologies could best accomplish this? Here are a couple things we have considered:

  1. Dynamic Linq to XML
  2. Shredding XML into SQL tables and generate dynamic SQL statements
  3. Creating some type of custom DSL (Iron Python, Boo, etc)

Biggest concerns are ability to implement rules on the fly, speed, and easy/flexibility authoring the rules.

Ideas?


Don't build this. Use a forward-chaining rules engine like BRE that comes with BizTalk.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜