SlideShare une entreprise Scribd logo
1  sur  51
Télécharger pour lire hors ligne
REST
Saturday, 2 June 2012
@CBSANCHEZ
• Programando desde 1997
• LISP, C++, Java, Ruby, outras
• Leitor eXtreme
Saturday, 2 June 2012
INTEGRAÇÃO
Saturday, 2 June 2012
COM+
RMI
SÓ ENTRE ELES
CORBA(PELO MENOS ELETENTOU)
Saturday, 2 June 2012
SOAP
REST
AMIGO DA GAROTADA
Saturday, 2 June 2012
SOAP
• Transporte Genérico (HTTP/HTTPS, JMS, SMTP)
• XML
• WS-*
• Statefull (WS-Security/WS-Coordination/WS-Transaction)
Saturday, 2 June 2012
REST
• Transport HTTP/HTTPS
• XML/JSON/Outros
• Hypermedia
• Stateless
Saturday, 2 June 2012
SOA
ENTERPRISE
Saturday, 2 June 2012
REST
MOBILE
Saturday, 2 June 2012
O INÍCIO (WEB)
Saturday, 2 June 2012
FRAMEWORKS
GET POST
Saturday, 2 June 2012
PUT? DELETE? PRA QUE?
Saturday, 2 June 2012
ROY FIELDING
ano: 2000
Saturday, 2 June 2012
REPRESENTATIONAL
STATE
TRANSFER
Saturday, 2 June 2012
REST
a style of software architecture
Saturday, 2 June 2012
RESTFUL
implementing such an architecture
Saturday, 2 June 2012
JSR 311: JAX-RS
JERSEY
RESTEASY
CXF
WCFTAMBÉM
RESTFULIE
Saturday, 2 June 2012
VAMOS PRO REST
Saturday, 2 June 2012
RESOURCE BASED
Saturday, 2 June 2012
• Todos os recursos (resources) são identificáveis
• Um recurso possui várias representações
• Link entre os recursos
• Usar os métodos da plataforma
• Comunicação stateless
PRINCÍPIOS
Saturday, 2 June 2012
ID DE RECURSOS
http://gdata.youtube.com/feeds/users/MysteryGuitarMan
Saturday, 2 June 2012
ID DE RECURSOS
• http://restbucks.com/customers/1234
• http://restbucks.com/orders/2007/10/776654
• http://restbucks.com/customers/1234/products
• http://restbucks.com/products?brand=sony
Saturday, 2 June 2012
RECURSO
QUALQUER ABSTRAÇÃO! MESMO!
Saturday, 2 June 2012
REPRESENTAÇÃO
SEU RECURSO EMVÁRIAS FORMAS!
XHTML
XML
JSON
CUSTOM
ATOM
Saturday, 2 June 2012
LINK ENTRE RECURSOS
<order self='http://restbucks.com/customers/1234'>
<amount>2</amount>
<product ref='http://restbucks.com/products/4554' />
<customer ref='http://restbucks.com/customers/1234' />
</order>
Saturday, 2 June 2012
SEGURO
Sem efeitos colaterais no servidor!
Saturday, 2 June 2012
IDEMPOTENTE
É a propriedade de certas operações na matemática e
computação onde o estado do recurso/aplicação não se
modifica após multiplas invocações.
Saturday, 2 June 2012
MÉTODOS PADRÃO
• GET – Seguro, Idempotente – Recupera um recurso
• PUT – Idempotente – Cria ou atualiza um recurso
identificado por uma URI
• DELETE – Idempotente – Exclui um recurso
• POST – Inseguro – Cria um recurso
Saturday, 2 June 2012
COMUNICAÇÃO STATELESS
• Estado no recurso ou no cliente
• Reduz o overload do server
• Reduz o acoplamento do cliente com o servidor
Saturday, 2 June 2012
CRUD
HYPERMEDIA
Saturday, 2 June 2012
CRUD
Saturday, 2 June 2012
CRUDTRADICIONAL
Saturday, 2 June 2012
CRUD REST
Saturday, 2 June 2012
CÓDIGOS HTTP
200 - OK
201 - OK, Created
204 - OK, No content
404 - Not Found
405 - Method Not Allowed
Saturday, 2 June 2012
HYPERMEDIA
Saturday, 2 June 2012
HYPERMEDIA
Links vem de HyperLinks...
HyperMedia vem do uso de HyperLinks...
Saturday, 2 June 2012
REPRESENTAÇÃO
A WEB É AGNOSTICA AO FORMATO,
SEU CLIENTE NÃO!
Saturday, 2 June 2012
REPRESENTAÇÃO
<order xmlns="http://schemas.restbucks.com">
<location>takeAway</location>
<item>
<name>latte</name>
<quantity>1</quantity>
<size>small</size>
</item>
<cost>2.59</costs>
<status>payment-expected</status>
<order>
Saturday, 2 June 2012
REPRESENTAÇÃO MELHOR
<order xmlns="http://schemas.restbucks.com">
<location>takeAway</location>
<item>
<name>latte</name>
<quantity>1</quantity>
<size>small</size>
</item>
<cost>2.59</costs>
<status>payment-expected</status>
<payment>http://restbucks.com/payment/1234</payment>
<cancel>http://restbucks.com/payment/1234</cancel>
</order>
Saturday, 2 June 2012
UMA REPRESENTAÇÃO BEM
MELHOR
<order xmlns="http://schemas.restbucks.com">
<location>takeAway</location>
<item>
<name>latte</name>
<quantity>1</quantity>
<size>small</size>
</item>
<cost>2.59</costs>
<status>payment-expected</status>
<link action="payment" href="http://restbucks.com/payment/1234" />
<link action="cancel" href="http://restbucks.com/payment/1234" />
</order>
Saturday, 2 June 2012
UMA REPRESENTAÇÃO BEM
MELHOR (AINDA!)
<order xmlns="http://schemas.restbucks.com">
<location>takeAway</location>
<item>
<name>latte</name>
<quantity>1</quantity>
<size>small</size>
</item>
<cost>2.59</costs>
<status>payment-expected</status>
<atom:link rel="payment" href="http://restbucks.com/payment/1234" />
<atom:link rel="cancel" href="http://restbucks.com/payment/1234" />
</order>
Saturday, 2 June 2012
RESTFULIE
• Java, Ruby, Objective-C
• Hypermedia
• Elegante!!
Saturday, 2 June 2012
RESTFULIE EVERBOS HTTP
• destroy, cancel, delete: DELETE
• update: PUT
• refresh, reload, show, latest: GET
• outros: POST
Saturday, 2 June 2012
CLIENTE RESTFULIE
// lista de relações
List<Relation> relations = resource(order).getRelations();
Order order = new Order();
// envia um Pedido
order = service("http://restbucks.com/order").post(order);
// cancela uma ordem
resource(order).getRelation("cancel").execute();
Saturday, 2 June 2012
TRANSAÇÕES
Saturday, 2 June 2012
TRANSAÇÕES
COMPENSATÓRIAS
• Transações ACID
• Sistema sabe como desfazer
Saturday, 2 June 2012
TRY-CANCEL/CONFIRM
Saturday, 2 June 2012
TRY-CANCEL/CONFIRM
<order xmlns="http://schemas.restbucks.com">
<location>takeAway</location>
<item>
<name>latte</name>
<quantity>1</quantity>
<size>small</size>
</item>
<cost>2.59</costs>
<status>payment-expected</status>
<atom:link rel="payment" href="http://restbucks.com/payment/1234" />
<atom:link rel="cancel" href="http://restbucks.com/payment/1234" />
</order>
Saturday, 2 June 2012
MAIS INFORMAÇÕES
• Rest In Practice, Jim Webber
Saturday, 2 June 2012
MAIS INFORMAÇÕES
• http://www.infoq.com/articles/rest-introduction
• http://restfulie.caelum.com.br/
• http://jersey.java.net/
Saturday, 2 June 2012
OBRIGADO!
Saturday, 2 June 2012

Contenu connexe

Dernier

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
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
Joaquim Jorge
 

Dernier (20)

08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
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
 
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
 
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
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
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)
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
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
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
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
 
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
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024
 
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...
 
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...
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 

En vedette

Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
Kurio // The Social Media Age(ncy)
 

En vedette (20)

Skeleton Culture Code
Skeleton Culture CodeSkeleton Culture Code
Skeleton Culture Code
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search Intent
 
How to have difficult conversations
How to have difficult conversations How to have difficult conversations
How to have difficult conversations
 
Introduction to Data Science
Introduction to Data ScienceIntroduction to Data Science
Introduction to Data Science
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best Practices
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project management
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
 
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
 
12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work
 
ChatGPT webinar slides
ChatGPT webinar slidesChatGPT webinar slides
ChatGPT webinar slides
 
More than Just Lines on a Map: Best Practices for U.S Bike Routes
More than Just Lines on a Map: Best Practices for U.S Bike RoutesMore than Just Lines on a Map: Best Practices for U.S Bike Routes
More than Just Lines on a Map: Best Practices for U.S Bike Routes
 
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
 

REST Overview