SlideShare a Scribd company logo
1 of 31
Da água ao vinho o caminho do desenvolvimento web Bruno Pereira
Palestrante ,[object Object]
7 anos de experiência com Java
8 anos de experiência com web
Um dos pioneiros em REST no Brasil
BP do Bem
 
 
 
 
 
 
Escalabilidade
Clean Code
Testing
Action-based x Component-based
Powered by Java 5
@ Resource public class ProcessoController { private ProcessoDAO dao; private Result result; public ProcessoController(ProcessoDAO dao, Result result) { this.dao = dao; this.result = result; } @ Get @ Path (&quot; /processo/index &quot;) public List<Processo> index() { return dao.buscarTodos(); } }
@ Post  @ Path (&quot; /processo &quot;) public void cadastro(Processo processo) { dao.salvar(processo); result.use(Results. json() ). from (processo) . serialize (); } @ Get  @ Path (&quot; /processo/{processo.id} &quot;) public void buscar(Processo processo) { processo = dao.buscar(processo.getId()); if (processo != null) {   result.use(Results. xml() ). from (processo) . serialize (); } else { result.use( Status .class). notFound (); } }
MockResult result = new MockResult(); ClienteController controller = new ClienteController(..., result); controller. list ();  List<Client> clients = result. included (&quot;clients&quot;); //cast automático Assert.assertNotNull(clients);
/articles/archive? date =08/01/08& page =2 public static void archive(Date  date , Integer  page ){ List<Article> articles = Articles.fromArchive( date ,  page ); render(articles); } public static void  show (Long id) { Article article = Article.findById(id); render(article); }  public static void  edit (Long id, String title) { Article article = Article.findById(id); article.title = title; article.save(); show (id); //  redirect to show }
// Templates Article  article  = Article.findById(id); User  user  = User.getConnected(); render( article ,  user ); // JPA public void messages(int page) { User  connectedUser  = User.find(&quot;byEmail&quot;, connected()); List<Message> messages = Message. find ( &quot;user = ? and read = false order by date desc&quot;, connectedUser). from (page * 10). fetch (10); render (connectedUser, messages); }
Java EE 6 ,[object Object]
IoC + ampla
Criteria
JSR-311
Async Servlets
POJOs.
 
Selectors/ Traversing $('div #corpo  div .destaque ') $(' /html/body//p ') $('p :eq(0) ') $('div :even ') $('div :has(p) ') $('span#description'). prev() $('div#disclaimer'). find('li')
Events/ Manipulation $('input:submit'). click(function()  { $(this). attr ('disabled', 'disabled'); }); $('p'). mouseover(function()  { $(this). css ('cursor', 'pointer'); });

More Related Content

Viewers also liked

De Mi Padre
De Mi PadreDe Mi Padre
De Mi Padre
nikitu
 
The CDO and the Delivery of Enterprise Value
The CDO and the Delivery of Enterprise ValueThe CDO and the Delivery of Enterprise Value
The CDO and the Delivery of Enterprise Value
Mark Albala
 
Rethinking Information Strategies
Rethinking Information StrategiesRethinking Information Strategies
Rethinking Information Strategies
Mark Albala
 
Enfermedad Arterial Periférica, Amel Bracho
Enfermedad Arterial Periférica, Amel BrachoEnfermedad Arterial Periférica, Amel Bracho
Enfermedad Arterial Periférica, Amel Bracho
UIS,Bucaramanga,Colombia
 
1 Ba T Pc Deconinck Stacey
1 Ba T Pc Deconinck Stacey1 Ba T Pc Deconinck Stacey
1 Ba T Pc Deconinck Stacey
stacey deconinck
 

Viewers also liked (19)

Rethinking information strategies
Rethinking information strategiesRethinking information strategies
Rethinking information strategies
 
De Mi Padre
De Mi PadreDe Mi Padre
De Mi Padre
 
The CDO and the Delivery of Enterprise Value
The CDO and the Delivery of Enterprise ValueThe CDO and the Delivery of Enterprise Value
The CDO and the Delivery of Enterprise Value
 
Carra L. Inquinamento e salute
Carra L. Inquinamento e saluteCarra L. Inquinamento e salute
Carra L. Inquinamento e salute
 
How to make your clients love you
How to make your clients love youHow to make your clients love you
How to make your clients love you
 
Organizing to manage information assets
Organizing to manage information assetsOrganizing to manage information assets
Organizing to manage information assets
 
Bm mlq 100 tmd
Bm mlq 100 tmdBm mlq 100 tmd
Bm mlq 100 tmd
 
Introducing a new approach for managing information in the digital economy
Introducing a new approach for managing information in the digital economyIntroducing a new approach for managing information in the digital economy
Introducing a new approach for managing information in the digital economy
 
Managing information in the digital age
Managing information in the digital ageManaging information in the digital age
Managing information in the digital age
 
1. welcome to the exponential age
1. welcome to the exponential age1. welcome to the exponential age
1. welcome to the exponential age
 
Rethinking Information Strategies
Rethinking Information StrategiesRethinking Information Strategies
Rethinking Information Strategies
 
A better approach to managing information
A better approach to managing informationA better approach to managing information
A better approach to managing information
 
Arquiteturas escaláveis e tolerantes a falhas
Arquiteturas escaláveis e tolerantes a falhasArquiteturas escaláveis e tolerantes a falhas
Arquiteturas escaláveis e tolerantes a falhas
 
QCon 2015 - DevOps, Chef, Puppet e Ansible e como vender milhões na Black Fri...
QCon 2015 - DevOps, Chef, Puppet e Ansible e como vender milhões na Black Fri...QCon 2015 - DevOps, Chef, Puppet e Ansible e como vender milhões na Black Fri...
QCon 2015 - DevOps, Chef, Puppet e Ansible e como vender milhões na Black Fri...
 
Enfermedad Arterial Periférica, Amel Bracho
Enfermedad Arterial Periférica, Amel BrachoEnfermedad Arterial Periférica, Amel Bracho
Enfermedad Arterial Periférica, Amel Bracho
 
Recognition of information value
Recognition of information valueRecognition of information value
Recognition of information value
 
1 Ba T Pc Deconinck Stacey
1 Ba T Pc Deconinck Stacey1 Ba T Pc Deconinck Stacey
1 Ba T Pc Deconinck Stacey
 
EXAMENES PREQUIRURGICOS
EXAMENES PREQUIRURGICOSEXAMENES PREQUIRURGICOS
EXAMENES PREQUIRURGICOS
 
The age of disruption
The age of disruptionThe age of disruption
The age of disruption
 

Similar to Da água pro vinho, o caminho do desenvolvimento web Java

Developing web apps using Java and the Play framework
Developing web apps using Java and the Play frameworkDeveloping web apps using Java and the Play framework
Developing web apps using Java and the Play framework
Victor Porof
 
Jersey framework
Jersey frameworkJersey framework
Jersey framework
knight1128
 
05 status-codes
05 status-codes05 status-codes
05 status-codes
snopteck
 
Micro-ORM Introduction - Don't overcomplicate
Micro-ORM Introduction - Don't overcomplicateMicro-ORM Introduction - Don't overcomplicate
Micro-ORM Introduction - Don't overcomplicate
Kiev ALT.NET
 

Similar to Da água pro vinho, o caminho do desenvolvimento web Java (20)

ActiveWeb: Chicago Java User Group Presentation
ActiveWeb: Chicago Java User Group PresentationActiveWeb: Chicago Java User Group Presentation
ActiveWeb: Chicago Java User Group Presentation
 
JavaCro'15 - GWT integration with Vaadin - Peter Lehto
JavaCro'15 - GWT integration with Vaadin - Peter LehtoJavaCro'15 - GWT integration with Vaadin - Peter Lehto
JavaCro'15 - GWT integration with Vaadin - Peter Lehto
 
Developing web apps using Java and the Play framework
Developing web apps using Java and the Play frameworkDeveloping web apps using Java and the Play framework
Developing web apps using Java and the Play framework
 
Jersey framework
Jersey frameworkJersey framework
Jersey framework
 
The Past Year in Spring for Apache Geode
The Past Year in Spring for Apache GeodeThe Past Year in Spring for Apache Geode
The Past Year in Spring for Apache Geode
 
05 status-codes
05 status-codes05 status-codes
05 status-codes
 
Android and the Seven Dwarfs from Devox'15
Android and the Seven Dwarfs from Devox'15Android and the Seven Dwarfs from Devox'15
Android and the Seven Dwarfs from Devox'15
 
May 2010 - RestEasy
May 2010 - RestEasyMay 2010 - RestEasy
May 2010 - RestEasy
 
Introduction to AJAX and DWR
Introduction to AJAX and DWRIntroduction to AJAX and DWR
Introduction to AJAX and DWR
 
Introduction To Groovy 2005
Introduction To Groovy 2005Introduction To Groovy 2005
Introduction To Groovy 2005
 
Vaadin Flow framework in a nutshell
Vaadin Flow framework in a nutshellVaadin Flow framework in a nutshell
Vaadin Flow framework in a nutshell
 
Micro-ORM Introduction - Don't overcomplicate
Micro-ORM Introduction - Don't overcomplicateMicro-ORM Introduction - Don't overcomplicate
Micro-ORM Introduction - Don't overcomplicate
 
DWR, Hibernate and Dojo.E - A Tutorial
DWR, Hibernate and Dojo.E - A TutorialDWR, Hibernate and Dojo.E - A Tutorial
DWR, Hibernate and Dojo.E - A Tutorial
 
RESTEasy
RESTEasyRESTEasy
RESTEasy
 
Jsp
JspJsp
Jsp
 
Android dev toolbox
Android dev toolboxAndroid dev toolbox
Android dev toolbox
 
Annotation processing and code gen
Annotation processing and code genAnnotation processing and code gen
Annotation processing and code gen
 
The Django Web Application Framework 2
The Django Web Application Framework 2The Django Web Application Framework 2
The Django Web Application Framework 2
 
The Django Web Application Framework 2
The Django Web Application Framework 2The Django Web Application Framework 2
The Django Web Application Framework 2
 
Struts 2 + Spring
Struts 2 + SpringStruts 2 + Spring
Struts 2 + Spring
 

More from Bruno Luiz Pereira da Silva

More from Bruno Luiz Pereira da Silva (8)

4 passos para a Transformação Digital
4 passos para a Transformação Digital4 passos para a Transformação Digital
4 passos para a Transformação Digital
 
Preparando sua arquitetura para microservicos
Preparando sua arquitetura para microservicosPreparando sua arquitetura para microservicos
Preparando sua arquitetura para microservicos
 
DevOps, Chef, Puppet, Ansible e como vender milhões na Black Friday com 100% ...
DevOps, Chef, Puppet, Ansible e como vender milhões na Black Friday com 100% ...DevOps, Chef, Puppet, Ansible e como vender milhões na Black Friday com 100% ...
DevOps, Chef, Puppet, Ansible e como vender milhões na Black Friday com 100% ...
 
Lean e Data Science para levar o turismo brasileiro a outro patamar
Lean e Data Science para levar o turismo brasileiro a outro patamarLean e Data Science para levar o turismo brasileiro a outro patamar
Lean e Data Science para levar o turismo brasileiro a outro patamar
 
Segurança e automação na Amazon: Lições das trincheiras
Segurança e automação na Amazon: Lições das trincheirasSegurança e automação na Amazon: Lições das trincheiras
Segurança e automação na Amazon: Lições das trincheiras
 
Construção de APIs profissionais em Java
Construção de APIs profissionais em JavaConstrução de APIs profissionais em Java
Construção de APIs profissionais em Java
 
Desenvolvimento web produtivo
Desenvolvimento web produtivoDesenvolvimento web produtivo
Desenvolvimento web produtivo
 
Web Services Rest
Web Services RestWeb Services Rest
Web Services Rest
 

Recently uploaded

Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
WSO2
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 

Recently uploaded (20)

Vector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptxVector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptx
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
Exploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusExploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with Milvus
 
Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​
 
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamDEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
 
CNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In PakistanCNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In Pakistan
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
 
Choreo: Empowering the Future of Enterprise Software Engineering
Choreo: Empowering the Future of Enterprise Software EngineeringChoreo: Empowering the Future of Enterprise Software Engineering
Choreo: Empowering the Future of Enterprise Software Engineering
 
Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)
 
API Governance and Monetization - The evolution of API governance
API Governance and Monetization -  The evolution of API governanceAPI Governance and Monetization -  The evolution of API governance
API Governance and Monetization - The evolution of API governance
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Understanding the FAA Part 107 License ..
Understanding the FAA Part 107 License ..Understanding the FAA Part 107 License ..
Understanding the FAA Part 107 License ..
 
AI+A11Y 11MAY2024 HYDERBAD GAAD 2024 - HelloA11Y (11 May 2024)
AI+A11Y 11MAY2024 HYDERBAD GAAD 2024 - HelloA11Y (11 May 2024)AI+A11Y 11MAY2024 HYDERBAD GAAD 2024 - HelloA11Y (11 May 2024)
AI+A11Y 11MAY2024 HYDERBAD GAAD 2024 - HelloA11Y (11 May 2024)
 
Introduction to use of FHIR Documents in ABDM
Introduction to use of FHIR Documents in ABDMIntroduction to use of FHIR Documents in ABDM
Introduction to use of FHIR Documents in ABDM
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf
 
AI in Action: Real World Use Cases by Anitaraj
AI in Action: Real World Use Cases by AnitarajAI in Action: Real World Use Cases by Anitaraj
AI in Action: Real World Use Cases by Anitaraj
 

Da água pro vinho, o caminho do desenvolvimento web Java

  • 1. Da água ao vinho o caminho do desenvolvimento web Bruno Pereira
  • 2.
  • 3. 7 anos de experiência com Java
  • 4. 8 anos de experiência com web
  • 5. Um dos pioneiros em REST no Brasil
  • 7.  
  • 8.  
  • 9.  
  • 10.  
  • 11.  
  • 12.  
  • 18. @ Resource public class ProcessoController { private ProcessoDAO dao; private Result result; public ProcessoController(ProcessoDAO dao, Result result) { this.dao = dao; this.result = result; } @ Get @ Path (&quot; /processo/index &quot;) public List<Processo> index() { return dao.buscarTodos(); } }
  • 19. @ Post @ Path (&quot; /processo &quot;) public void cadastro(Processo processo) { dao.salvar(processo); result.use(Results. json() ). from (processo) . serialize (); } @ Get @ Path (&quot; /processo/{processo.id} &quot;) public void buscar(Processo processo) { processo = dao.buscar(processo.getId()); if (processo != null) { result.use(Results. xml() ). from (processo) . serialize (); } else { result.use( Status .class). notFound (); } }
  • 20. MockResult result = new MockResult(); ClienteController controller = new ClienteController(..., result); controller. list (); List<Client> clients = result. included (&quot;clients&quot;); //cast automático Assert.assertNotNull(clients);
  • 21. /articles/archive? date =08/01/08& page =2 public static void archive(Date date , Integer page ){ List<Article> articles = Articles.fromArchive( date , page ); render(articles); } public static void show (Long id) { Article article = Article.findById(id); render(article); } public static void edit (Long id, String title) { Article article = Article.findById(id); article.title = title; article.save(); show (id); // redirect to show }
  • 22. // Templates Article article = Article.findById(id); User user = User.getConnected(); render( article , user ); // JPA public void messages(int page) { User connectedUser = User.find(&quot;byEmail&quot;, connected()); List<Message> messages = Message. find ( &quot;user = ? and read = false order by date desc&quot;, connectedUser). from (page * 10). fetch (10); render (connectedUser, messages); }
  • 23.
  • 29.  
  • 30. Selectors/ Traversing $('div #corpo div .destaque ') $(' /html/body//p ') $('p :eq(0) ') $('div :even ') $('div :has(p) ') $('span#description'). prev() $('div#disclaimer'). find('li')
  • 31. Events/ Manipulation $('input:submit'). click(function() { $(this). attr ('disabled', 'disabled'); }); $('p'). mouseover(function() { $(this). css ('cursor', 'pointer'); });
  • 33. YSlow
  • 34. Java in the Enterprise
  • 35.  
  • 36.  
  • 37.  
  • 38.  

Editor's Notes

  1. - CGIs invocavam aplicações dentro da máquina, passando valores através de variáveis de ambiente - Servlets inovaram ao passar a usar threads p/ request em vez de criar novos processos
  2. DRY CoC Frameworks de persistência integrados REST Linguagens de tipagem dinâmica Foco no código
  3. - Web server embutido - Scaffold - Gerador de CRUD c/ Ajax - CoC - É a opção com mais sucesso comercial - Forte comunidade no Brasil e no mundo - Excelentes ferramentas para TDD/BDD - Tem feito excelente uso da plataforma Java, reduzindo drasticamente as questões de escalabilidade
  4. - Semelhante a RoR em muitos aspectos. - Framework for perfectionists with deadlines - Criado para atender com qualidade aos prazos curtos de um ambiente editorial muito dinâmico - Geração de um Admin de conteúdo muito poderoso, que poupa muito tempo de desenvolvimento - Framework Python - Enorme comunidade, muito ativa
  5. - Mto semelhante a RoR, mas ideal para devs que vieram de Java e querem aproveitar skills - Feito em Groovy, sobre Spring, Hibernate e Sitemesh. - Oferece os enormes benefícios de Spring/Hibernate de forma bem menos complexa, mas sem tirar o poder. - É a opção de mais fácil integração com Java - Gera WAR padrão Java - Comunidade bem menor do que Django e Rails - Será que tem futuro dentro da VMWare?
  6. Threads em vez de processos Enorme evolução da JVM NIO: IO não bloqueante C10k Comets
  7. Attribute-oriented programming Annotations + generics CoC IoC POJOs x Herança + Interfaces ↑ Código ↓ Ferramentas
  8. Testes fora do container IoC TDD, BDD Containers cada vez mais leves Testes de controllers do VRaptor
  9. CB são adequados p/ aplicações RIA, não sites AB cada vez mais RESTFul Stateless x Stateful Nível diferente de controle de JS O futuro é RESTFul!
  10. - Linguagem com características OO e funcionais - Vista como sucessora natural de Java, embora provavelmente não vejamos uma opção com a adoção de Java - Estaticamente tipada - 2 a 3x menos código comparando com Java - Lift roda em qualquer servlet container 2.4+ Java. Podemos usar qualquer lib Java. - Comets, XML, JSON, JPA