任何Java企业级应用可以分成三个部分 −

  • UI – 用户界面(前端)

  • 服务层连接到数据库

  • 业务层

我们有一些框架,用来处理UI和业务层在一起,例如,Spring和Struts。然而,我们没有一个标准的方式来处理业务逻辑,直到Drools的出现。

Drools是什么?

Drools是一个业务逻辑集成平台(BLip)。它是用Java编写。它是由JBoss和红帽公司扩展支持,并实现Rete模式匹配算法的一个开源项目。

通俗地说,Drools是一种工具,使我们能够分离内部业务流程,找到逻辑和数据的集合。我们需要注意的两个重要关键词是逻辑和数据。

Drools的被分成两个主要部分:编写和运行系统。

  • 制作: 制作过程涉及创建规则文件(.DRL文件)。

  • 运行时: 它涉及到创建工作存储器和处理活化。

什么是规则引擎?

Drools is Rule Engine or a Production Rule System that uses the rule-based approach to implement and Expert System. Expert Systems are knowledge-based systems that use knowledge representation to process acquired knowledge into a knowledge base that can be used for reasoning.

A Production Rule System is Turing complete with a focus on knowledge representation to express propositional and first-order logic in a concise, non-ambiguous and declarative manner.

The brain of a Production Rules System is an Inference Engine that can scale to a large number of rules and facts. The Inference Engine matches facts and data against Production Rules – also called Productions or just Rules – to infer conclusions which result in actions.

A Production Rule is a two-part structure that uses first-order logic for reasoning over knowledge representation. A business rule engine is a software system that executes one or more business rules in a runtime production environment.

A Rule Engine allows you to define “What to Do” and not “How to do it.”

What is a Rule?

Rules are pieces of knowledge often expressed as, "When some conditions occur, then do some tasks."

When
    <Condition is true>Then
    <Take desired Action>

The most important part of a Rule is its when part. If the when part is satisfied, the thenpart is triggered.

rule  <rule_name>
      <attribute> <value>
      
      when
         <conditions>
      
      then
         <actions>end

Pattern Matching

The process of matching the new or existing facts against Production Rules is called Pattern Matching, which is performed by the Inference Engine. There are a number of algorithms used for Pattern Matching including:

  • Linear

  • Rete

  • Treat

  • Leaps

Drools Implements and extends the Rete Algorithm. The Drools Rete implementation is called ReteOO, signifying that Drools has an enhanced and optimized implementation of the Rete algorithm for object-oriented systems.

Advantages of a Rule Engine

Declarative Programming

Rules make it easy to express solutions to difficult problems and get the solutions verified as well. Unlike codes, Rules are written in less complex language; Business Analysts can easily read and verify a set of rules.

Logic and Data Separation

The data resides in the Domain Objects and the business logic resides in the Rules. Depending upon the kind of project, this kind of separation can be very advantageous.

Speed and Scalability

The Rete OO algorithm on which Drools is written is already a proven algorithm. With the help of Drools, your application becomes very scalable. If there are frequent change requests, one can add new rules without having to modify the existing rules.

Centralization of Knowledge

By using Rules, you create a repository of knowledge (a knowledge base) which is executable. It is a single point of truth for business policy. Ideally, Rules are so readable that they can also serve as documentation.

Tool Integration

Tools such as Eclipse provide ways to edit and manage rules and get immediate feedback, validation, and content assistance. Auditing and debugging tools are also available.


1032阅读 | 0评论
你的回应
  • voxoqukuvo

    2019-09-06 16:10:06 voxoqukuvo

    The ntt.riod.osbaike.net.oia.kw rebuild [URL=http://cerisefashion.com/zoloft/]zoloft[/URL] [URL=http://solepost.com/cheap-cialis/]cialis 20[/URL] [URL=http://modreview.net/retin-a/]retin a cream[/URL] [URL=http://meetatsonoma.com/amoxicillin/]amoxicillin 500 mg[/URL] [URL=http://secretsofthearchmages.net/prilosec/]generic prilosec[/URL] [URL=http://iliannloeb.com/rosuvastatin/]rosuvastatin[/URL] rosuvastatin [URL=http://freemonthlycalender.com/inderal/]inderal canada[/URL] donation verbally captopril, zoloft for

  • eqimajuhice

    2019-09-02 22:44:04 eqimajuhice

    Insert zie.zkjs.osbaike.net.byr.ic words; [URL=http://charlotteelliottinc.com/kamagra/]kamagra[/URL] [URL=http://cgodirek.com/digoxin/]digoxin lowest price[/URL] [URL=http://ralstoncommunity.org/lasix/]lasix online[/URL] [URL=http://sallyrjohnson.com/buy-prednisone/]prednisone[/URL] [URL=http://telugustoday.com/benemid/]buy benemid[/URL] [URL=http://myquickrecipes.com/viagra/]price of 100mg viagra[/URL] [URL=http://cgodirek.com/aciphex/]aciphex lowest price[/URL] secondary, reheat k

  • eqolfou

    2019-08-26 13:57:32 eqolfou

    Most mwp.xxcq.osbaike.net.idc.mc elastic, step, [URL=http://wellnowuc.com/lasix/]lasix online[/URL] [URL=http://solepost.com/cialis-20-mg-price/]lowest price for cialis 20 mg[/URL] [URL=http://sbmitsu.com/penegra/]penegra without dr prescription[/URL] [URL=http://vintagepowderpuff.com/cialis/]cialis 10mg[/URL] [URL=http://rockymountainmbaa.com/cialis-com/]cialis.com lowest price[/URL] [URL=http://passagesinthevoid.com/xalatan/]online xalatan[/URL] [URL=http://puresportsnetwork.com/buy-propecia-online/]propecia[/URL] albumin radicals, protruded

  • SuperSlotsswedy

    2019-08-25 01:58:22 SuperSlotsswedy

    Доброго времени суток! Не упустите момент получить самые "новые предложения" проекта игорного заведения Casino-X! [b]Казино онлайн Casino-X доступен на любом языке[/b] и для самых актуальных стран! [b]Азартный клуб - зеркало Casino-X - [/b][url=https://cosino-x.xyz/][b]Бесплатный сувенир ради регу[/b][/url] [b]Пример игры - можно играть сразу на этом сайте без регистрации и бесплатно - ЖМИ НА КАРТИНКУ ИГРЫ[/b] Рекомендую [URL=https://zdes-kino.ru/]фильмы хорошего каче

  • owiwaci

    2019-08-11 15:43:17 owiwaci

    Emergency nnw.axxb.osbaike.net.txd.mb inadvertent [URL=http://discoveryshows.com/cialis-soft/]buy cialis soft[/URL] cialis soft lowest price [URL=http://gaiaenergysystems.com/dapoxetine/]priligy[/URL] [URL=http://discoveryshows.com/viagra-soft/]viagra soft online[/URL] [URL=http://elegantearthatthearbor.com/valtrex-online/]valtrex neck ache[/URL] [URL=http://vintagepowderpuff.com/viagra-online/]buy viagra online[/URL] viagra for sale [URL=http://davincipictures.com/kamagra/]buy kamagra online[/URL] [URL=http://earthbeours.com/cialis-canadian-pharmacy/]generic cialis canadian pharmacy[/URL] [URL=http://davincipictures.com/viagra-buy-in-canada/]cheep viagra[/URL] enhancing warm, cialis soft lowest price priligy dapoxetine order viagra soft online valtrex online viagra cheap kamagra buy cialis online canada pharmacy generic viagra 50 mg hidden http://discoveryshows.com/cialis-soft/ cialis soft http://gaiaenergysystems.com/dapoxetine/ dapoxetine online http://discoveryshows.com/viagra-soft/ viagra soft online http://elegantearthatthearbor.com/valtrex-online/ valtrex online valtrex online http://vintagepowderpuff.com/viagra-online/ viagra for sale http://davincipictures.com/kamagra/ kamagra http://earthbeours.com/cialis-canadian-pharmacy/ on line pharmacy http://davincipictures.com/viagra-buy-in-canada/ v

  • abmirecafiuma

    2019-08-03 22:57:41 abmirecafiuma

    The ifl.rsjk.osbaike.net.hgg.gj oesophagectomy; periosteal [URL=http://washingtonsharedparenting.com/lisinopril/]personal injury lisinopril[/URL] [URL=http://jacksfarmradio.com/ventolin-inhaler-for-sale/]ventolin inhaler[/URL] [URL=http://buckeyejeeps.com/super-kamagra/]super kamagra generic[/URL] [URL=http://bikramcentennial.com/indocin/]indocin colchicine[/URL] [URL=http://puresportsnetwork.com/pharmacy/]pharmacy[/URL] [URL=http://mrcpromotions.com/rulide/]online rulide[/URL] [URL=http://fitnesscabbage.com/cialis-com-lowest-price/]cialis tadalafil 20 mg ta

  • ukudalvuwope

    2019-07-23 21:40:42 ukudalvuwope

    Other qjb.qdng.osbaike.net.avb.yh space-occupying [URL=http://timoc.org/viagra-online/]viagra.com[/URL] [URL=http://nicaragua-magazine.com/viagra-100mg/]viagra canada[/URL] [URL=http://nicaragua-magazine.com/viagra/]viagra[/URL] [URL=http://timoc.org/prednisone-20-mg/]prednisone[/URL] [URL=http://earthbeours.com/viagra-generic/]viagra[/URL] [URL=http://nicaragua-magazine.com/viagra-online/]viagra 100mg price walmart[/URL] [URL=http://dead-fish.com/buy-cialis/]cialis online[/URL] [URL=http://thebestworkoutplan.com/tadalafil-20-mg/]buy tadalafil online[/URL] cialis generic 20 mg [URL=http://nicaragua-magazine.com/cialis-20-mg/]cialis.com[/URL] irrespective viagra for sale viagra canada cheap viagra deltasone and pregnancy category cheap viagra pills canadian viagra cialis prezzo farmacia cialis lowest price for cialis 20 mg cialis 20 mg fasciculus non-pregnant parasite http://timoc.org/viagra-online/ viagra generic paypal http://nicaragua-magazine.com/viagra-100mg/ viagra on line http://nicaragua-magazine.com/viagra/ buy viagra online http://timoc.org/prednisone-20-mg/ prednisone 10 mg http://earthbeours.com/viagra-generic/ online viagra http://nicaragua-magazine.com/viagra-online/ viagra online http://dead-fish.com/buy-cialis/ cialis from canada http://t

  • enuuxadled

    2019-07-12 08:47:21 enuuxadled

    It xpu.gfhw.osbaike.net.bev.ov conducting [URL=http://heavenlyhappyhour.com/fluoxetine/]fluoxetine lowest price[/URL] [URL=http://quotes786.com/vidalista/]potenzmittel ginerika vidalista[/URL] [URL=http://iowansforsafeaccess.org/tadalafil-20-mg/]cialis 20 mg[/URL] [URL=http://disclosenews.com/revia/]price of revia[/URL] [URL=http://heavenlyhappyhour.com/vidalista/]vidalista[/URL] [URL=http://bootstrapplusplus.com/cialis-5mg/]cialis 10mg[/URL] [URL=http://thefashionhob.com/cheap-cialis/]cialis[/URL] [URL=http://quotes786.com/cialis-professi

  • iminasayatxi

    2019-06-29 21:17:11 iminasayatxi

    Some fio.aarx.osbaike.net.dmz.xg dread overhearing tarso-metatarsal [URL=http://quotes786.com/cialis-professional/]cialis professional without dr prescription[/URL] [URL=http://dive-courses-bali.com/prednisone/]buy prednisone online in us[/URL] [URL=http://thefashionhob.com/cialis-20-mg-price/]how many mg does cialis come in[/URL] [URL=http://livetvchannels.org/viagra-super-active/]viagra super active[/URL] [URL=http://tattoosideasblog.com/cialis-online/]cialis online[/URL] [URL=http://quotes786.com/eriacta-for-sale/]eriacta[/URL] [URL=http://heavenlyhappyhour.com%

  • uqeboxaloquc

    2019-06-26 22:34:04 uqeboxaloquc

    To oah.msli.osbaike.net.nmq.pe whooping [URL=http://quotes786.com/vidalista/]discount vidalista[/URL] [URL=http://heavenlyhappyhour.com/vidalista/]vidalista 20 recensioni[/URL] [URL=http://bootstrapplusplus.com/lasix/]lasix[/URL] [URL=http://solartechnicians.net/lyrica/]lyrica[/URL] [URL=http://alwaseetgulf.com/tadalafil-20-mg/]cialis[/URL] headedness, lower-third tamponade vidalista vidalista without a prescription

1 2345
联系我们