SRE(Simple Rule Engine) Document

What is a rule engine?
什么是规则引擎?
A Rule Engine is a software system that contains rules on behalf of another system. Many different kinds of rules can be contained in a rules engine: business, legal, company policy, navigation, computational. An example, a website that prompts the user to fill out a form that has dependencies between pages could use a rule engine to control the verification of the validity of the form and the navigition between pages. Another example, a bank could have a set of rules that dictate the interest rate and fee's associated with a checking account. It also provides a means to classify and manage rules in a centralized location instead of being hardcoded throughout an application.

 

Why use a rule engine?
为什么使用规则引擎?
Most companies business strategies are constantly in flux due to their changing internal and external environments; the CEO has a new idea on increasing sales, consumer base is being eroded by a more aggressive competition, current business practices wiill soon be out of compliance due to changes in regulations. How do handle changes in a system in an maintainable, reusable, extensibility, and ownership?
由于内部外部的环境地变化,大多数公司的商业经营策略会经常持续地变动。CEO 有一个新的想法,增加销售量,顾客 以减少竞争对手的不断侵蚀。当今商业仍没有脱离依赖,正是由于变化的规则。怎么把握系统的变化,做到可维持,可重用,可扩展,和所有权等?

Maintainability is increased by using a rule engine by centralizing the rules. Typically a non-rule engine based systems that contain rules of moderate complexity will implement its rules in methods of objects that encapsulate business logic (business objects). They refer to other business objects that form associations with other business objects, typically creating an intricate web of associations. Since these objects are tightly coupled changes to them can have rippling effects throughout the collection. Clarity of the rules in such a system can be quite poor when the rules cross these objects. Not only is it difficult for a developer to understand the details of such relationships, but even more so to change them.
规则引擎通过集中规则来增强系统的可维护性。对于不基于规则引擎的含有规则的系统,典型的简化复杂性的处理方法是将它的规则插入业务逻辑对象的方法中。这 些业务逻辑对象涉及到其他业务逻辑对象,尤其是形成的错综复杂的关系网。那些对象紧紧地联系的变化会透过对象集成产生联动效果。清晰的规则贯穿于这些对象 实体中,这样系统就变得相当的不健壮。对于开发人员仅仅理解这些关系的详细内容就是困难的,更甚至是要改变这些关系。

Typically a rule engine based system will use a proxy class that delegates a call to a rule engine.
基于规则引擎的系统典型的方法就是使用一个代理类通过委托调用规则引擎。

Ownership of rules can be shifted to business units with a rule engine, especially with SRE. Rules being declarity in nature are easy to understand.  SRE was designed around its rules being contained in a simple to understand XML file, hence the word SIMPLE in SRE. XML should take no more than a day to learn; they even have XML for dummies and XML in 24hours books.
系统自有的规则都转移到集中的规则引擎中,尤其使用SRE。规则使用容易理解的自然语言描述。SRE设计将规则放置在简单易于理解的XML文档中。XML很容易学习,可以不超过一天时间,就有一些 XML in 24hours 等书籍
 

What is SRE (Simple Rule Engine)?
什么是SRE(Simple Rule Engine)?
From a technical perspective, SRE is a comprehensive, flexible product aimed at enabling software developers to create applications that can be mainteained with minimal effort and directly supported by designated business users. It leverates the flexibility and robustness of XML into a context that business users can understand and own freeing developers to work on new functionality.  It allows developers to combine rule-based and object oriented programmng methods to add business rules to new and existing applications.  Hence the name of this product, Simple Rule Engine.

 

How does SRE simplify our development?
怎么让SRE简化我们的开发过程?
1. SRE makes it easy to create, edit, store, and organize rules.
2. SRE's XML is the simpliest possible manner of describing rules.
3. Rules are declaritive, not procedural, in nature allowing problems to be broken down into discrete pieces.
4. SRE allows rules to be seperated from your application allowing for flexibility for future changes.

 

Why would I want to use SRE instead of a full blown rule engine?
为什么我要使用它而不是一个完整的规则引擎?
A full blown rule engine, like NxBRE (also open source), is far more capable than SRE but it comes at a price. That ability has a price, SRE has far better performance and is far easier to understand. Not every application needs the complexity of a bull blown rule engine, sometimes a simple one will do just fine and sometimes it wont. Choose wisely.

 

What kind of rule engines are there?
规则引擎都有什么样的类型呢?
Chaining refers to the relationship between the rules; forward and backwards refer to the direction of that relationship.

Forward chaining : Often refered to being 'data driven' due to the fact that the data determines the truthality of the rule.
(Rule) If my car is green, then
(Action) my house red.
(Fact) I have a green car.
(therefore) I have a red house.

Backwards-chaining : Often refered to being 'goal driven' due to the fact that we are trying to determine if something exists based on existing information.
(Rule) If my car is green, then
(Action) my house red.
(Fact) My house is NOT red.
(therefore) I dont have a green car.

hybrid :  combination of the above two.

 

What is contained in a rule engine?
一个规则引擎都包含哪些内容?
Rule engines typically support rules, facts, priority (score), mutual exclusion, preconditions, and other functions. Because SRE's goal is to be simple and not a full blown rule engine, it only supports rules, facts, and actions.

 

What kind of rule engine is SRE?
SRE属于哪一类规则引擎?
forward chaining

 

What is declararitive programming?
(modified version from drool)
Declarative programming deals with what is, as opposed with the how to normally encountered in imperative programming languages. SRE allows for rules to be decoupled and lowers the unidirectional logical flow. Declarative rules typically take the form as follows:

http://sourceforge.net/docman/display_doc.php?docid=30688&group_id=139180

转载于:https://www.cnblogs.com/august/archive/2008/07/26/1252154.html

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mzph.cn/news/264534.shtml

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

字符串匹配,KMP算法

KMP的详解见&#xff1a;https://segmentfault.com/a/1190000008575379 主要难点在于Next数组的理解&#xff0c;KMP是不需要回溯的匹配算法。 1 #include<iostream>2 #include<string>3 #include<vector>4 #define MAXSIZE 1005 using namespace std;6 /*为…

{}企业如何才能实现多方位网络营销

现在很多企业都在进行网络营销,但是网络营销取得显着效果的并不多.其中有各种原因.但是很多在网络营销方式取得显着效果的企业却都有个共同的特点,尝试了多种营销方式做多方位的网络营销.在现今网络平台多样化,网络营销竞争激烈的形式下,单一的营销模式确实无法取得好的效果,多…

关于23种设计模式的有趣见解

创建型模式 1、FACTORY —追MM少不了请吃饭了&#xff0c;麦当劳的鸡翅和肯德基的鸡翅都是MM爱吃的东西&#xff0c;虽然口味有所不同&#xff0c;但不管你带MM去麦当劳或肯德基&#xff0c;只管向服务员说“来四个鸡翅”就行了。麦当劳和肯德基就是生产鸡翅的Factory 工厂模式…

java oracle 连接字符串函数_通过shell来比较oracle和java中的字符串使用

这些准备工作齐了之后&#xff0c;我们来从Java中的字符串使用入手来比较一下oracle中对于字符串的处理。java中有如下的一些函数&#xff0c;我会依次来做比较。public char charAt(int index)返回字符串中第index个字符&#xff1b;oracle中可以使用substr来简单实现&#xf…

Java私有构造函数不能阻止继承

下面是一个调用已经私有化的单列的函数的列子. 这里用了静态内部类&#xff0c;关键就是静态内部类可以访问外部类的私有构造函数。 这种算是变种继承吧。前提是可以在原来的单列类里添加代码。 class Single { private Single(){ System.out.println(&q…

Flask + vue 前后端分离的 二手书App

一个Flask vue 前后端分离的 二手书App 效果展示&#xff1a; https://blog.csdn.net/qq_42239520/article/details/88534955 所用技术清单 项目地址&#xff1a;项目地址 vue代码地址&#xff1a;vue代码地址 项目部分过程笔记&#xff1a; 后台&#xff1a; 项目结构 Second…

Mac OS X Glut build instructions

Mac OS X Glut build instructions(在Mac上用glut库编写OpenGL程序) Wentao Sun, Autodesk, Inc. 1. Building GLUT apps under Mac OS X There are only a few modifications you need to make to the robot.c sample to get it compiled on your Mac. These instruction…

李战java_【阿里李战】解剖JavaScript中的 null 和 undefined

在JavaScript开发中&#xff0c;被人问到&#xff1a;null与undefined到底有啥区别&#xff1f;一时间不好回答&#xff0c;特别是undefined&#xff0c;因为这涉及到undefined的实现原理。于是&#xff0c;细想之后&#xff0c;写下本文&#xff0c;请各位大侠拍砖。总所周知&…

Android -- 获取摄像头帧数据解码

由于Android下摄像头预览数据只能 ImageFormat.NV21 格式的&#xff0c;所以解码时要经过一翻周折. Camera mCamera Camera.open();Camera.Parameters p mCamera.getParameters();p.setPreviewFormat(ImageFormat.NV21);/*这是唯一值&#xff0c;也可以不设置。有些同学可能…

跨域方法

1.jsonp,原理利用script的src属性(像img,iframe等有src属性的都支持跨域)引入js文件&#xff0c;并在引入成功后调用回调函数&#xff0c;数据通过参数的形式传过来。 例&#xff1a; 2.window.name 3.document.domain 4.h5的方法&#xff1a;window.postMessage 5.flash 6.COR…

C#发送Email邮件方法总结

通过.Net FrameWork 2.0下提供的“System.Net.Mail”可以轻松的实现&#xff0c;本文列举了3种途径来发送&#xff1a; 1.通过Localhost&#xff1b; 2.通过普通SMTP; 3.通过SSL的SMTP; 下面一个一个来说&#xff1a; 1.通过LocalHost 1public void SendMailLocalhost() 2 ...{…

java多线程之wait_(三)java多线程之wait notify notifyAll

引言今天我打算讲一下Object.wait,Object.notify,Object.notifyAll这三个方法. 首先我们查看一下api看看,官方api对这几个方法的介绍.理论Object.wait(): 导致当前线程一直等待,直到另一外一个线程用同一个对象调用Object.notify或Object.notifyAll方法.换种说法,就是调用Objec…

得不到和已失去

凉凉滑滑&#xff0c;这样的天气&#xff0c;我该喜欢的&#xff0c;就像在酷暑时所盼望的一样。可是又一次在凌晨凉飕飕的空气中醒来时&#xff0c;为什么我却倍感凄凉的蜷成一团怀念盛夏的热烈了呢。更加恶劣的是&#xff0c;为什么在正午炙热的阳光下&#xff0c;我却又在怀…

lightoj 1020 (博弈)

思路&#xff1a;很简单的博弈&#xff0c;找出每个人先拿的必胜态进行状态转移即可。#include<cstdio> #include<string> #include<cstring> #include<iostream> #include<algorithm> using namespace std; int main(){int t, n, CASE(0);char …

2019 GDUT Rating Contest II : A. Taming the Herd

题面&#xff1a; A. Taming the Herd Input file: standard inputOutput file: standard outputTime limit: 1 secondMemory limit: 256 megabytesEarly in the morning, Farmer John woke up to the sound of splintering wood. It was the cows, and they were breaking out…

仅对此用户禁用 java_Spring Security实现禁止用户重复登陆的配置原理

这篇文章主要介绍了Spring Security实现禁止用户重复登陆的配置原理,文中通过示例代码介绍的非常详细&#xff0c;对大家的学习或者工作具有一定的参考学习价值,需要的朋友可以参考下系统使用了Spring Security做权限管理&#xff0c;现在对于系统的用户&#xff0c;需要改动配…

SQL server 系统优化--通过执行计划优化索引(1) (转)

SQL server 系统优化--通过执行计划优化索引&#xff08;1&#xff09; 前几天,远离上海&#xff0c;到了温州&#xff0c;在客户的这边处理系统慢&#xff0c;该系统每天正常down机7次左右&#xff0c;在线人员一多&#xff0c;系统运行缓慢&#xff0c;严重影响业务操作,到了…

Linux运维系统工程师系列---13

定制安装定制安装&#xff0c;也叫源码安装&#xff0c;需要自己编译源代码的安装方式步骤&#xff1a;1、解压源代码包2、配置 configure3、编译 make4、安装 make install接下来开始做实验&#xff0c;希望朋友们自己动手实践&#xff0c;有啥不清楚的可以直接提问我&#xf…

java system.setproperties_在JAVA中 System.getProperty 和 System.setProperty 方法.

今天着手研究TOMCAT源码.在刚開始的时候Startup类中init方法中调用非常多次System.getProperty和System.setProperty的方法.后来经过网上搜索才得知,这是对操作系统变量操作的方法.System还提供一个静态方法 System.getProperties(). 这种方法能够罗列出你系统的所有变量.调用S…

雷林鹏分享:XML 编码

XML 编码 XML 文档可以包含非 ASCII 字符&#xff0c;比如挪威语 &#xff0c;或者法语 。 为了避免错误&#xff0c;需要规定 XML 编码&#xff0c;或者将 XML 文件存为 Unicode。 XML 编码错误 如果您载入一个 XML 文档&#xff0c;您可以得到两个不同的错误&#xff0c;…