当前位置:网站首页>Rule engine mode Net open source project case

Rule engine mode Net open source project case

2022-06-11 19:48:00 Solution jdon

What is the rule engine pattern ? Where to use ?

Implement rule engine pattern ,SOLID Principle is a good choice .

The project of business rules is through if/else Function to implement , But in many of our business rules , We need to write more regular code ,if/else Make things more complicated .

On the other hand , When a new set of rules is defined , Instead of defining a new stream block , We will create a more readable 、 Simple 、 Improved and flexible structure , Instead of defining a new class .

The rules engine has two components :

  1. The rules engine determines how rules are executed .
  2. Business rules - Conditions .

Applying the rule engine pattern is very simple . I hope you can get rid of those used to pass a lot of control ifelse block .

Click on the title to see Github Source code

原网站

版权声明
本文为[Solution jdon]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/03/202203011807162533.html