SlideShare uma empresa Scribd logo
1 de 35
motor de regras
@porcelli


#TDC2010
   #DROOLS
WTF?
EXPERT?
?
COMO
FUNCIONA...
VISÃO GERAL
             Inference Engine
                  (ReteOO)


Production       Pattern        Working
 Memory          Matcher        Memory
   (rules)                       (facts)




                  Agenda
FACT: POJO
    	   public static class Message {
    	   	
    	   	   public static final int HELLO = 0;
    	   	   public static final int GOODBYE = 1;

    	   	   private String message;

    	   	   private int status;

    	   	   public String getMessage() {
    	   	   	   return this.message;
    	   	   }

    	   	   public void setMessage(String message) {
    	   	   	   this.message = message;
    	   	   }

    	   	   public int getStatus() {
    	   	   	   return this.status;
    	   	   }

    	   	   public void setStatus(int status) {
    	   	   	   this.status = status;
    	   	   }
    	   	
    	   }
RULE: DSL

 rule "Hello World"
 	 when
 	 	 m : Message( status == Message.HELLO, myMessage : message )
 	 then
 	 	 System.out.println( myMessage );
 end
ALGORÍTIMO
VANTAGENS
FACILIDADE DE
ENTENDIMENTO
MANUTENÇÃO MAIS
     FÁCIL
FLEXIBILIDADE
MENOR IMPEDÂNCIA
  NA DEFINIÇÃO
   DE REGRAS
GESTÃO
QUANDO NÃO USAR
PROJETO
    [PEQUENO]
SEM MUITAS REGRAS
REGRAS QUE
DIFICILMENTE MUDAM
FALTA DE EXPERIÊNCIA
       COM A
    TECNOLOGIA
DISVANTAGENS?
DIFICULDADES...
PENSAR DIFERENTE!
DEBUGGING
MEMÓRIA
DEMO!
OPS... JÁ IA ME
ESQUECENDO...
PERFORMANCE!
QUER SABER MAIS?
QUER SABER MAIS?
QUER SABER MAIS?
Perguntas?
Obrigado


alexandre.porcelli@gmail.com

github.com/porcelli

linkedin.com/in/alexandreporcelli

@porcelli

porcelli.com.br

Mais conteúdo relacionado

Semelhante a Motor de Regras @ TDC2010

Midiendo la calidad de código en WTF/Min (Revisado EUI Abril 2014)
Midiendo la calidad de código en WTF/Min (Revisado EUI Abril 2014)Midiendo la calidad de código en WTF/Min (Revisado EUI Abril 2014)
Midiendo la calidad de código en WTF/Min (Revisado EUI Abril 2014)
David Gómez García
 
The state of PHPUnit
The state of PHPUnitThe state of PHPUnit
The state of PHPUnit
Edorian
 
The State of PHPUnit
The State of PHPUnitThe State of PHPUnit
The State of PHPUnit
Edorian
 
Save time by applying clean code principles
Save time by applying clean code principlesSave time by applying clean code principles
Save time by applying clean code principles
Edorian
 

Semelhante a Motor de Regras @ TDC2010 (18)

An intro to programming
An intro to programmingAn intro to programming
An intro to programming
 
Java - A broad introduction
Java - A broad introductionJava - A broad introduction
Java - A broad introduction
 
What Lies Beneath
What Lies BeneathWhat Lies Beneath
What Lies Beneath
 
A brief introduction to PostgreSQL
A brief introduction to PostgreSQLA brief introduction to PostgreSQL
A brief introduction to PostgreSQL
 
Lego for Software Engineers at Silicon Valley Code Camp 2011 (2010-10-10)
Lego for Software Engineers at Silicon Valley Code Camp 2011 (2010-10-10)Lego for Software Engineers at Silicon Valley Code Camp 2011 (2010-10-10)
Lego for Software Engineers at Silicon Valley Code Camp 2011 (2010-10-10)
 
Deuce STM - CMP'09
Deuce STM - CMP'09Deuce STM - CMP'09
Deuce STM - CMP'09
 
Midiendo la calidad de código en WTF/Min (Revisado EUI Abril 2014)
Midiendo la calidad de código en WTF/Min (Revisado EUI Abril 2014)Midiendo la calidad de código en WTF/Min (Revisado EUI Abril 2014)
Midiendo la calidad de código en WTF/Min (Revisado EUI Abril 2014)
 
The state of PHPUnit
The state of PHPUnitThe state of PHPUnit
The state of PHPUnit
 
The State of PHPUnit
The State of PHPUnitThe State of PHPUnit
The State of PHPUnit
 
JVM Mechanics: A Peek Under the Hood
JVM Mechanics: A Peek Under the HoodJVM Mechanics: A Peek Under the Hood
JVM Mechanics: A Peek Under the Hood
 
The State of PHPUnit
The State of PHPUnitThe State of PHPUnit
The State of PHPUnit
 
[CCC-28c3] Post Memory Corruption Memory Analysis
[CCC-28c3] Post Memory Corruption Memory Analysis[CCC-28c3] Post Memory Corruption Memory Analysis
[CCC-28c3] Post Memory Corruption Memory Analysis
 
Priming Java for Speed at Market Open
Priming Java for Speed at Market OpenPriming Java for Speed at Market Open
Priming Java for Speed at Market Open
 
Save time by applying clean code principles
Save time by applying clean code principlesSave time by applying clean code principles
Save time by applying clean code principles
 
Modern Java Workshop
Modern Java WorkshopModern Java Workshop
Modern Java Workshop
 
Tricks to Making a Realtime SurfaceView Actually Perform in Realtime - Maarte...
Tricks to Making a Realtime SurfaceView Actually Perform in Realtime - Maarte...Tricks to Making a Realtime SurfaceView Actually Perform in Realtime - Maarte...
Tricks to Making a Realtime SurfaceView Actually Perform in Realtime - Maarte...
 
Pure Java RAD and Scaffolding Tools Race
Pure Java RAD and Scaffolding Tools RacePure Java RAD and Scaffolding Tools Race
Pure Java RAD and Scaffolding Tools Race
 
Is writing performant code too expensive?
Is writing performant code too expensive? Is writing performant code too expensive?
Is writing performant code too expensive?
 

Mais de Alexandre Porcelli

noSQL e ORM, será que dá samba?
noSQL e ORM, será que dá samba?noSQL e ORM, será que dá samba?
noSQL e ORM, será que dá samba?
Alexandre Porcelli
 
noSQL - Uma nova escola de pensamento
noSQL - Uma nova escola de pensamentonoSQL - Uma nova escola de pensamento
noSQL - Uma nova escola de pensamento
Alexandre Porcelli
 
J1Brasil: Persistência de Dados além do JPA, ou Como usar noSQL em Java
J1Brasil: Persistência de Dados além do JPA, ou Como usar noSQL em JavaJ1Brasil: Persistência de Dados além do JPA, ou Como usar noSQL em Java
J1Brasil: Persistência de Dados além do JPA, ou Como usar noSQL em Java
Alexandre Porcelli
 
ANTLR Conference - OpenSpotLight driven by ANTLR
ANTLR Conference - OpenSpotLight driven by ANTLRANTLR Conference - OpenSpotLight driven by ANTLR
ANTLR Conference - OpenSpotLight driven by ANTLR
Alexandre Porcelli
 
Antlr Conference Drools & Hibernate
Antlr Conference   Drools & HibernateAntlr Conference   Drools & Hibernate
Antlr Conference Drools & Hibernate
Alexandre Porcelli
 

Mais de Alexandre Porcelli (17)

Dawn of the citizen developer
Dawn of the citizen developerDawn of the citizen developer
Dawn of the citizen developer
 
Running rules and processes in the cloud
Running rules and processes in the cloudRunning rules and processes in the cloud
Running rules and processes in the cloud
 
Impulsione sua carreira contribuindo para projetos open source
Impulsione sua carreira contribuindo para projetos open sourceImpulsione sua carreira contribuindo para projetos open source
Impulsione sua carreira contribuindo para projetos open source
 
Armazenamento de Dados em Poucas Palavras ou Uma resposta definitiva para tod...
Armazenamento de Dados em Poucas Palavras ou Uma resposta definitiva para tod...Armazenamento de Dados em Poucas Palavras ou Uma resposta definitiva para tod...
Armazenamento de Dados em Poucas Palavras ou Uma resposta definitiva para tod...
 
DevinVale: SQL, noSQL ou newSQL - Onde armazenar meus dados?
DevinVale:  SQL, noSQL ou newSQL - Onde armazenar meus dados?DevinVale:  SQL, noSQL ou newSQL - Onde armazenar meus dados?
DevinVale: SQL, noSQL ou newSQL - Onde armazenar meus dados?
 
noSQL e ORM, será que dá samba?
noSQL e ORM, será que dá samba?noSQL e ORM, será que dá samba?
noSQL e ORM, será que dá samba?
 
noSQL - Uma nova escola de pensamento
noSQL - Uma nova escola de pensamentonoSQL - Uma nova escola de pensamento
noSQL - Uma nova escola de pensamento
 
noSQL @ MSTechDay São Paulo
noSQL @ MSTechDay São PaulonoSQL @ MSTechDay São Paulo
noSQL @ MSTechDay São Paulo
 
SQL, NoSQL ou NewSQL: Onde armazenar meus dados?
SQL, NoSQL ou NewSQL: Onde armazenar meus dados?SQL, NoSQL ou NewSQL: Onde armazenar meus dados?
SQL, NoSQL ou NewSQL: Onde armazenar meus dados?
 
A importância dos dados em sua arquitetura... uma visão muito além do SQL Ser...
A importância dos dados em sua arquitetura... uma visão muito além do SQL Ser...A importância dos dados em sua arquitetura... uma visão muito além do SQL Ser...
A importância dos dados em sua arquitetura... uma visão muito além do SQL Ser...
 
J1Brasil: Persistência de Dados além do JPA, ou Como usar noSQL em Java
J1Brasil: Persistência de Dados além do JPA, ou Como usar noSQL em JavaJ1Brasil: Persistência de Dados além do JPA, ou Como usar noSQL em Java
J1Brasil: Persistência de Dados além do JPA, ou Como usar noSQL em Java
 
noSQL WTF?! - Citi2010
noSQL WTF?! - Citi2010noSQL WTF?! - Citi2010
noSQL WTF?! - Citi2010
 
noSQL @ QCon SP
noSQL @ QCon SPnoSQL @ QCon SP
noSQL @ QCon SP
 
noSQL além do buzz
noSQL além do buzznoSQL além do buzz
noSQL além do buzz
 
OpenSpotLight - Concepts
OpenSpotLight - ConceptsOpenSpotLight - Concepts
OpenSpotLight - Concepts
 
ANTLR Conference - OpenSpotLight driven by ANTLR
ANTLR Conference - OpenSpotLight driven by ANTLRANTLR Conference - OpenSpotLight driven by ANTLR
ANTLR Conference - OpenSpotLight driven by ANTLR
 
Antlr Conference Drools & Hibernate
Antlr Conference   Drools & HibernateAntlr Conference   Drools & Hibernate
Antlr Conference Drools & Hibernate
 

Último

CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
giselly40
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
Enterprise Knowledge
 

Último (20)

CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 

Motor de Regras @ TDC2010

Notas do Editor