Expert System/Rules Engine
What is a expert system?
“… an intelligent computer program that uses knowledge and interface procedures to solve problems that are difficult enough to require significant human expertise for their solution.”
What is a rules engine?
- a generalized expert system in which the expertise (the domain knowledge) is missing, to be entered via some form of programming language at a later date
Como organizar sua regra de negócios e manter essas regras enquanto o sistema vive não é uma trabalho fácil.
Queremos gerenciar isso “out of computer system” através de uma arquitetura fácil.
Architecture (typical)
- interence engine (pattern matcher, agenda, execution engine)
- Rule base
- Working memomry
Você ou qualquer um pode escrever uma regra de negócio. Se isso não for muito bem estruturado você pode perder o foco.
Quais regras colocar na agenda para serem executadas!
A brief Glossary might be in order
- Rete (ree-tee) algorithm
- Forward-chaining
- Backward-chaining
Facts vs Rules (People, Wheter, time and date).
Não existem links entre os Fatcts. Não existem links entre Rules (Não existe links entre objetos do mesmo tipo)
Analisar quais regras mudam os fatos e quais fatos mudam as regras.
Quanto mais rápido você definir e conhecer suas regras de negócios, mais rápido sua aplicação será desenvolvida.
Several rules engines implementation exist
- iLOG Rules (.NET and java; commercial)
- Drools/JBos Rules (.NET and Java,open-source)
- NxBRE
- WorkFlow Rules
- BizTalk Server
- Windows WorkFlow comes with a rule engine
- Rules criadas como Schemas.
Dentre do código
Retorne um objeto contendo as informações e o erro como parte da coleção. Caso algum erro ocorra, você testa fora do componente. Não utilize “ThrowException”!!!
Nenhum comentário:
Postar um comentário