Rules engine design pattern demonstration and samples. Link to the github repo with samples - https://github.com/stanimirtt/rules-engine
Size: 2.42 MB
Language: en
Added: Oct 20, 2016
Slides: 12 pages
Slide Content
Rules Engine Design Patterns
Rules engine R eplacing imperative model: commands in sequence with conditionals and loops set of rules – each rule has condition and action
Rules engine address the following issue if car.owner.hasCellPhone then premium += 100; if car.model.theftRating > 4 then premium += 200; if car.owner.livesInDodgyArea && car.model.theftRating > 2 then premium += 300 ;
The solution
Rules engine diagram
What are the benefits S ingle Responsibility Principle (SRP ) O pen/Close Principle (OCP) L iskov substitution principle (LSP) I nterface segregation principle D ependency inversion principle