SlideShare a Scribd company logo
1 of 47
REST
and Resource Oriented Architecture
okcDG
March 2008
Ryan Hoegg
Valtech Technologies
REST, ROA, and Web Services
Architectural style of the WWW
One way to build RESTful
web services
Not very well defined
REST:
ROA:
Web Services:
So what is “Web Services”?
...hem hem haw hem haw...
What they said
<shrug/> Here's some software.
They're great! Buy our tools!
W3C:
Wikipedia:
Apache:
Microsoft:
So what is “Web Services”??
Software services deployed on the WWW
intended for use by other software components
What is REST?
Architectural style for distributed hypermedia systems
Behind the architecture of the WWW
Described in “Architectural Styles and the Design of
Network-based Software Architectures” by Roy T.
Fielding
Software Architecture
A set of rules about the components, connectors,
and data in a software system intended to induce
some desired properties.
“...A software architecture is an abstraction of the run-time
elements of a software system during some phase of its
operation.”
--Roy T. Fielding
Architectural Style
“a set of rules that an architecture should
conform to”
-- from the RestWiki
“...a coordinated set of architectural constraints that restricts
the roles/features of architectural elements and the allowed
relationships among those elements within any architecture that
conforms to that style.”
-- Roy T. Fielding
Architectural Constraints
Addressable Resources
Statelessness
Connectedness
Uniform Interface
Resource?
Any information or concept that can be named.
The key abstraction of information in REST
Representation
The information about a resource that is
transmitted across the network.
Addressability
A resource identifier should represent only one
resource.
Statelessness
The server never stores any application state.
Each request can be considered in isolation.
“Connectedness”
The server includes levers of state in the
representations it sends to the client.
Uniform Interface
Resources share interface characteristics.
For example: methods, identifiers, data types
What does it buy me?
Large surface area
Scalable and Reliable
Easy to use and Robust
Transparent and Reliable
Addressable =
Stateless =
Connected =
Uniform =
Where REST came from
CERN – ENQUIRE project
MOMSpider and libwww-perl
mailing list for NCSA httpd becomes
the Apache HTTPD Project
REST guides the architecture of the
WWW, and the WWW serves as a
testbed for the ideas behind REST
1990-1992:
1993-1994:
1994-1995:
1995-now:
REST on the Web
URI
HTTP
Hypermedia
URI
Uniform Resource Identifier
Provides addressability of resources
e.g. http://okcpro.net/Events/MeetingsEvents/tabid/60/Default.aspx
Hypermedia?
Hypertext is text with links and forms.
Hypermedia expands this to include other
representations such as SVG.
HTTP
GET /Events/MeetingsEvents/tabid/60/Default.aspx
HTTP/1.1
Host: okcpro.net
HTTP/1.1 200 OK
Date: Mon, 10 Mar 2008 05:10:43 GMT
...
Content-Type: text/html
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 ...
<html lang="en-US">
<head>
...
<title>Meetings and Events</title>...
HTTP Methods
Retrieve a resource
Retrieve resource metadata
Determine the methods supported by
a resource
Create or update a resource
Destroy a resource
Create a new subordinate resource
GET
HEAD
OPTIONS
PUT
DELETE
POST
Safety
A safe request does not change resource state
Idempotence
An idempotent request has the same effect if it
succeeds once or more than once
HTTP Response Codes
A set of standardized codes that describe the
outcome of an HTTP request.
100-199: Informational
200-299: Success
300-399: Redirection
400-499: Client error
500-599: Server error
HTTP Headers
Metadata about an HTTP request or response.
Some headers are control metadata, while others
are resource metadata.
Resource Oriented Architecture
“...a set of concrete rules for building web services that really
will be RESTful”
--Richardson and Ruby, “RESTful Web Services”
Resource Oriented Architecture
Method information:
What should the service do in response to this
request?
This is the HTTP method.
Resource Oriented Architecture
Scoping information:
On what data should the service operate?
This belongs in the URI.
ROA Oversimplified
1. Figure out the data set
2. Split the data into resources
For each kind of resource:
3. Name the resources with URIs
4. Expose a subset of the uniform interface
5. Design the representation(s) accepted from the client
6. Design the representation(s) served to the client
7. Integrate this resource into the others, using links and forms
8. What's supposed to happen?
9. What might go wrong?
Adapted from “RESTful Web Services”, by Richardson and Ruby
http://www.decentpizza.com/
A simple pizza delivery web service
http://www.decentpizza.com/
A simple pizza delivery web service
Cool domain name huh?
http://www.decentpizza.com/
A simple pizza delivery web service
There's a squatter in Ohio who thought so.
Some User Stories
Menu
Current Specials
Place Order
Check Order Status
Cancel Order
1. Figure out the data set
a menu of pizzas, sides, and toppings which have a
photo, a price, and a description
a special has a discounted price for one or more menu
items, and will expire.
an order has a creation time, a total price, a delivery
address, a status, and one or more menu items
2. Split the data set into resources
a menu
a pizza, identified by name
a side, identified by name
the list of available pizza toppings
a topping, identified by name
the list of current specials
a special
an order
3. Name the resources with URIs
the menu: http://www.decentpizza.com/menu
a pizza: http://www.decentpizza.com/menu/pizza/{name}
a side: http://www.decentpizza.com/menu/side/{name}
the list of toppings:
http://www.decentpizza.com/menu/toppings
a topping: http://www.decentpizza.com/menu/topping/
{name}
the list of current specials:
http://www.decentpizza.com/menu/specials
a special: http://www.decentpizza.com/menu/special/
{id}
an order: http://www.decentpizza.com/orders/{id}
4. Expose a subset of the uniform interface
For the menu and below: GET, HEAD, and OPTIONS
To place an order: POST
http://www.decentpizza.com/orders
To check order status: GET
http://www.decentpizza.com/orders/{id}
To cancel an order: DELETE
http://www.decentpizza.com/orders/{id}
5. Design the representation(s) accepted
from the client
Placing an order:
6. Design the representation(s) served to
the client
The menu:
6. Design the representation(s) served to
the client
An order:
7. Integrate this resource with other
resources using links and forms
When the client GETs an order, it includes a form that
describes how to cancel it:
8. What's supposed to happen?
For the menu and below: GET, HEAD, and OPTIONS
Response Code: 200 (OK)
POST http://www.decentpizza.com/orders :
Response Code: 201 (Created)
Location: http://www.decentpizza.com/orders/{new id}
GET http://www.decentpizza.com/orders/{id}:
Response Code: 200 (OK)
DELETE http://www.decentpizza.com/orders/{id}:
Response Code: 200 (OK)
9. What might go wrong?
The client may try to access a menu item or
special that doesn't exist, like
/menu/drinks/margarita
404 (“Not Found”)
9. What might go wrong?
The client might try to cancel an order that's
already been cancelled
404 (“Not Found”)
9. What might go wrong?
The client might POST an order that my service
doesn't understand
400 (“Bad Request”)
9. What might go wrong?
My ordering back end might be down
500 (“Internal Server Error”)
Where to learn more
The RestWiki
Roy T. Fielding's dissertation
RESTful Web Services (book)
The World Wide Web (surprised?)

More Related Content

What's hot

Rest presentation
Rest  presentationRest  presentation
Rest presentationsrividhyau
 
The Rest Architectural Style
The Rest Architectural StyleThe Rest Architectural Style
The Rest Architectural StyleRobert Wilson
 
Understanding REST
Understanding RESTUnderstanding REST
Understanding RESTNitin Pande
 
Rest & RESTful WebServices
Rest & RESTful WebServicesRest & RESTful WebServices
Rest & RESTful WebServicesPrateek Tandon
 
Some REST Design Patterns (and Anti-Patterns) - SOA Symposium 2009
Some REST Design Patterns (and Anti-Patterns) - SOA Symposium 2009Some REST Design Patterns (and Anti-Patterns) - SOA Symposium 2009
Some REST Design Patterns (and Anti-Patterns) - SOA Symposium 2009Cesare Pautasso
 
RESTful Architecture
RESTful ArchitectureRESTful Architecture
RESTful ArchitectureKabir Baidya
 
How to build a rest api.pptx
How to build a rest api.pptxHow to build a rest api.pptx
How to build a rest api.pptxHarry Potter
 
Representational State Transfer (REST)
Representational State Transfer (REST)Representational State Transfer (REST)
Representational State Transfer (REST)Abhay Ananda Shukla
 
REST - Representational state transfer
REST - Representational state transferREST - Representational state transfer
REST - Representational state transferTricode (part of Dept)
 
Best practices for RESTful web service design
Best practices for RESTful web service designBest practices for RESTful web service design
Best practices for RESTful web service designRamin Orujov
 
The Internet as Web Services: introduction to ReST
The Internet as Web Services: introduction to ReSTThe Internet as Web Services: introduction to ReST
The Internet as Web Services: introduction to ReSTBruno Kessler Foundation
 
Restful Web Services
Restful Web ServicesRestful Web Services
Restful Web ServicesAngelin R
 
External Data Access with jQuery
External Data Access with jQueryExternal Data Access with jQuery
External Data Access with jQueryDoncho Minkov
 
REST and RESTful Web Services
REST and RESTful Web ServicesREST and RESTful Web Services
REST and RESTful Web ServicesKasun Madusanke
 

What's hot (20)

Rest presentation
Rest  presentationRest  presentation
Rest presentation
 
The Rest Architectural Style
The Rest Architectural StyleThe Rest Architectural Style
The Rest Architectural Style
 
Hypermedia APIs
Hypermedia APIsHypermedia APIs
Hypermedia APIs
 
Understanding REST
Understanding RESTUnderstanding REST
Understanding REST
 
Rest & RESTful WebServices
Rest & RESTful WebServicesRest & RESTful WebServices
Rest & RESTful WebServices
 
Rest and Rails
Rest and RailsRest and Rails
Rest and Rails
 
Some REST Design Patterns (and Anti-Patterns) - SOA Symposium 2009
Some REST Design Patterns (and Anti-Patterns) - SOA Symposium 2009Some REST Design Patterns (and Anti-Patterns) - SOA Symposium 2009
Some REST Design Patterns (and Anti-Patterns) - SOA Symposium 2009
 
RESTful Architecture
RESTful ArchitectureRESTful Architecture
RESTful Architecture
 
How to build a rest api.pptx
How to build a rest api.pptxHow to build a rest api.pptx
How to build a rest api.pptx
 
JSON and REST
JSON and RESTJSON and REST
JSON and REST
 
Representational State Transfer (REST)
Representational State Transfer (REST)Representational State Transfer (REST)
Representational State Transfer (REST)
 
REST - Representational state transfer
REST - Representational state transferREST - Representational state transfer
REST - Representational state transfer
 
Best practices for RESTful web service design
Best practices for RESTful web service designBest practices for RESTful web service design
Best practices for RESTful web service design
 
Rest API
Rest APIRest API
Rest API
 
Rest in Rails
Rest in RailsRest in Rails
Rest in Rails
 
The Internet as Web Services: introduction to ReST
The Internet as Web Services: introduction to ReSTThe Internet as Web Services: introduction to ReST
The Internet as Web Services: introduction to ReST
 
Restful Web Services
Restful Web ServicesRestful Web Services
Restful Web Services
 
Soap and Rest
Soap and RestSoap and Rest
Soap and Rest
 
External Data Access with jQuery
External Data Access with jQueryExternal Data Access with jQuery
External Data Access with jQuery
 
REST and RESTful Web Services
REST and RESTful Web ServicesREST and RESTful Web Services
REST and RESTful Web Services
 

Viewers also liked

LUMINESCE™ YOUTH RESTORING CLEANSER
LUMINESCE™ YOUTH RESTORING CLEANSERLUMINESCE™ YOUTH RESTORING CLEANSER
LUMINESCE™ YOUTH RESTORING CLEANSERBelinda Mejorada
 
ΓΑΙΤΑΝΟΣ-16-6-2016
ΓΑΙΤΑΝΟΣ-16-6-2016ΓΑΙΤΑΝΟΣ-16-6-2016
ΓΑΙΤΑΝΟΣ-16-6-2016Marios Gaitanos
 
Indicators and dilemma of breast feeding assessment last
Indicators and dilemma of breast feeding assessment last Indicators and dilemma of breast feeding assessment last
Indicators and dilemma of breast feeding assessment last Tarek Al 3reeny
 
Lagu Tema Merdeka Baru
Lagu Tema Merdeka BaruLagu Tema Merdeka Baru
Lagu Tema Merdeka BaruAlida Aiman
 
Agilität braucht Stabilität
Agilität braucht StabilitätAgilität braucht Stabilität
Agilität braucht StabilitätZUKUNFTheute.net
 
Nurses in Finnish health care system
Nurses in Finnish health care systemNurses in Finnish health care system
Nurses in Finnish health care systemTHL
 
Metso capital markets day 2015: CEO Matti Kähkönen
Metso capital markets day 2015: CEO Matti KähkönenMetso capital markets day 2015: CEO Matti Kähkönen
Metso capital markets day 2015: CEO Matti KähkönenMetso Group
 
1973 regulation of externalities - bergstrom
1973   regulation of externalities - bergstrom1973   regulation of externalities - bergstrom
1973 regulation of externalities - bergstromErasmo Fuentes
 
Managing stack traces
Managing stack tracesManaging stack traces
Managing stack tracesSon Nguyen
 
Github plugin setup in anypointstudio
Github plugin setup in anypointstudioGithub plugin setup in anypointstudio
Github plugin setup in anypointstudioRajkattamuri
 
Zen booklet italian
Zen booklet italianZen booklet italian
Zen booklet italianjiraia80
 
Clustering concepts
Clustering conceptsClustering concepts
Clustering conceptsHarish43
 
research proposal-project
research proposal-projectresearch proposal-project
research proposal-projectMarios Gaitanos
 
Mule api and service management
Mule api and service managementMule api and service management
Mule api and service managementD.Rajesh Kumar
 
Mule api and service management
Mule api and service managementMule api and service management
Mule api and service managementD.Rajesh Kumar
 

Viewers also liked (20)

LUMINESCE™ YOUTH RESTORING CLEANSER
LUMINESCE™ YOUTH RESTORING CLEANSERLUMINESCE™ YOUTH RESTORING CLEANSER
LUMINESCE™ YOUTH RESTORING CLEANSER
 
ΓΑΙΤΑΝΟΣ-16-6-2016
ΓΑΙΤΑΝΟΣ-16-6-2016ΓΑΙΤΑΝΟΣ-16-6-2016
ΓΑΙΤΑΝΟΣ-16-6-2016
 
Indicators and dilemma of breast feeding assessment last
Indicators and dilemma of breast feeding assessment last Indicators and dilemma of breast feeding assessment last
Indicators and dilemma of breast feeding assessment last
 
Lagu Tema Merdeka Baru
Lagu Tema Merdeka BaruLagu Tema Merdeka Baru
Lagu Tema Merdeka Baru
 
Agilität braucht Stabilität
Agilität braucht StabilitätAgilität braucht Stabilität
Agilität braucht Stabilität
 
Nurses in Finnish health care system
Nurses in Finnish health care systemNurses in Finnish health care system
Nurses in Finnish health care system
 
Metso capital markets day 2015: CEO Matti Kähkönen
Metso capital markets day 2015: CEO Matti KähkönenMetso capital markets day 2015: CEO Matti Kähkönen
Metso capital markets day 2015: CEO Matti Kähkönen
 
1973 regulation of externalities - bergstrom
1973   regulation of externalities - bergstrom1973   regulation of externalities - bergstrom
1973 regulation of externalities - bergstrom
 
skg n
skg nskg n
skg n
 
Managing stack traces
Managing stack tracesManaging stack traces
Managing stack traces
 
Github plugin setup in anypointstudio
Github plugin setup in anypointstudioGithub plugin setup in anypointstudio
Github plugin setup in anypointstudio
 
Zen booklet italian
Zen booklet italianZen booklet italian
Zen booklet italian
 
Anypoint vpc
Anypoint vpcAnypoint vpc
Anypoint vpc
 
Clustering concepts
Clustering conceptsClustering concepts
Clustering concepts
 
Mule ESB
Mule ESBMule ESB
Mule ESB
 
research proposal-project
research proposal-projectresearch proposal-project
research proposal-project
 
MULE-JAAS
MULE-JAASMULE-JAAS
MULE-JAAS
 
Mule api and service management
Mule api and service managementMule api and service management
Mule api and service management
 
Mule api and service management
Mule api and service managementMule api and service management
Mule api and service management
 
Mule tcat server
Mule  tcat serverMule  tcat server
Mule tcat server
 

Similar to REST and Resource Oriented Architecture - okcDG March 2008

Together Cheerfully to Walk with Hypermedia
Together Cheerfully to Walk with HypermediaTogether Cheerfully to Walk with Hypermedia
Together Cheerfully to Walk with HypermediaVladimir Tsukur
 
REST Introduction.ppt
REST Introduction.pptREST Introduction.ppt
REST Introduction.pptKGSCSEPSGCT
 
Resting on your laurels will get you powned
Resting on your laurels will get you pownedResting on your laurels will get you powned
Resting on your laurels will get you pownedDinis Cruz
 
Introduction to REST and Jersey
Introduction to REST and JerseyIntroduction to REST and Jersey
Introduction to REST and JerseyChris Winters
 
API Design, A Quick Guide to REST, SOAP, gRPC, and GraphQL, By Vahid Rahimian
API Design, A Quick Guide to REST, SOAP, gRPC, and GraphQL, By Vahid RahimianAPI Design, A Quick Guide to REST, SOAP, gRPC, and GraphQL, By Vahid Rahimian
API Design, A Quick Guide to REST, SOAP, gRPC, and GraphQL, By Vahid RahimianVahid Rahimian
 
Restful Fundamentals
Restful FundamentalsRestful Fundamentals
Restful FundamentalsSuresh Madhra
 
Restful Fundamentals
Restful FundamentalsRestful Fundamentals
Restful FundamentalsSuresh Madhra
 
Innovate2014 Better Integrations Through Open Interfaces
Innovate2014 Better Integrations Through Open InterfacesInnovate2014 Better Integrations Through Open Interfaces
Innovate2014 Better Integrations Through Open InterfacesSteve Speicher
 
Web of things introduction
Web of things introductionWeb of things introduction
Web of things introduction承翰 蔡
 
distributing over the web
distributing over the webdistributing over the web
distributing over the webNicola Baldi
 
APIdays San Francisco, 06/22/2013
APIdays San Francisco, 06/22/2013APIdays San Francisco, 06/22/2013
APIdays San Francisco, 06/22/2013Jerome Louvel
 
From Web APIs to Cross-Device Web Sites
From Web APIs to Cross-Device Web SitesFrom Web APIs to Cross-Device Web Sites
From Web APIs to Cross-Device Web SitesRestlet
 

Similar to REST and Resource Oriented Architecture - okcDG March 2008 (20)

Modified REST Presentation
Modified REST PresentationModified REST Presentation
Modified REST Presentation
 
Together Cheerfully to Walk with Hypermedia
Together Cheerfully to Walk with HypermediaTogether Cheerfully to Walk with Hypermedia
Together Cheerfully to Walk with Hypermedia
 
REST Introduction.ppt
REST Introduction.pptREST Introduction.ppt
REST Introduction.ppt
 
Resting on your laurels will get you powned
Resting on your laurels will get you pownedResting on your laurels will get you powned
Resting on your laurels will get you powned
 
Introduction to REST and Jersey
Introduction to REST and JerseyIntroduction to REST and Jersey
Introduction to REST and Jersey
 
WebApp #3 : API
WebApp #3 : APIWebApp #3 : API
WebApp #3 : API
 
REST Presentation
REST PresentationREST Presentation
REST Presentation
 
API Design, A Quick Guide to REST, SOAP, gRPC, and GraphQL, By Vahid Rahimian
API Design, A Quick Guide to REST, SOAP, gRPC, and GraphQL, By Vahid RahimianAPI Design, A Quick Guide to REST, SOAP, gRPC, and GraphQL, By Vahid Rahimian
API Design, A Quick Guide to REST, SOAP, gRPC, and GraphQL, By Vahid Rahimian
 
REST Presentation
REST PresentationREST Presentation
REST Presentation
 
Web Services
Web ServicesWeb Services
Web Services
 
Restful Fundamentals
Restful FundamentalsRestful Fundamentals
Restful Fundamentals
 
Restful Fundamentals
Restful FundamentalsRestful Fundamentals
Restful Fundamentals
 
Innovate2014 Better Integrations Through Open Interfaces
Innovate2014 Better Integrations Through Open InterfacesInnovate2014 Better Integrations Through Open Interfaces
Innovate2014 Better Integrations Through Open Interfaces
 
Web of things introduction
Web of things introductionWeb of things introduction
Web of things introduction
 
Restful webservices
Restful webservicesRestful webservices
Restful webservices
 
REST & RESTful Web Services
REST & RESTful Web ServicesREST & RESTful Web Services
REST & RESTful Web Services
 
The Glory of Rest
The Glory of RestThe Glory of Rest
The Glory of Rest
 
distributing over the web
distributing over the webdistributing over the web
distributing over the web
 
APIdays San Francisco, 06/22/2013
APIdays San Francisco, 06/22/2013APIdays San Francisco, 06/22/2013
APIdays San Francisco, 06/22/2013
 
From Web APIs to Cross-Device Web Sites
From Web APIs to Cross-Device Web SitesFrom Web APIs to Cross-Device Web Sites
From Web APIs to Cross-Device Web Sites
 

Recently uploaded

ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...Christina Lin
 
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASEBATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASEOrtus Solutions, Corp
 
Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)
Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)
Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)jennyeacort
 
Intelligent Home Wi-Fi Solutions | ThinkPalm
Intelligent Home Wi-Fi Solutions | ThinkPalmIntelligent Home Wi-Fi Solutions | ThinkPalm
Intelligent Home Wi-Fi Solutions | ThinkPalmSujith Sukumaran
 
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024StefanoLambiase
 
Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)OPEN KNOWLEDGE GmbH
 
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed DataAlluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed DataAlluxio, Inc.
 
Building Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop SlideBuilding Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop SlideChristina Lin
 
chapter--4-software-project-planning.ppt
chapter--4-software-project-planning.pptchapter--4-software-project-planning.ppt
chapter--4-software-project-planning.pptkotipi9215
 
Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...
Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...
Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...OnePlan Solutions
 
Implementing Zero Trust strategy with Azure
Implementing Zero Trust strategy with AzureImplementing Zero Trust strategy with Azure
Implementing Zero Trust strategy with AzureDinusha Kumarasiri
 
Salesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantSalesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantAxelRicardoTrocheRiq
 
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdfGOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdfAlina Yurenko
 
Recruitment Management Software Benefits (Infographic)
Recruitment Management Software Benefits (Infographic)Recruitment Management Software Benefits (Infographic)
Recruitment Management Software Benefits (Infographic)Hr365.us smith
 
Cloud Data Center Network Construction - IEEE
Cloud Data Center Network Construction - IEEECloud Data Center Network Construction - IEEE
Cloud Data Center Network Construction - IEEEVICTOR MAESTRE RAMIREZ
 
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...gurkirankumar98700
 
Cloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStackCloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStackVICTOR MAESTRE RAMIREZ
 
Professional Resume Template for Software Developers
Professional Resume Template for Software DevelopersProfessional Resume Template for Software Developers
Professional Resume Template for Software DevelopersVinodh Ram
 
英国UN学位证,北安普顿大学毕业证书1:1制作
英国UN学位证,北安普顿大学毕业证书1:1制作英国UN学位证,北安普顿大学毕业证书1:1制作
英国UN学位证,北安普顿大学毕业证书1:1制作qr0udbr0
 

Recently uploaded (20)

ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
 
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASEBATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
 
Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)
Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)
Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)
 
Intelligent Home Wi-Fi Solutions | ThinkPalm
Intelligent Home Wi-Fi Solutions | ThinkPalmIntelligent Home Wi-Fi Solutions | ThinkPalm
Intelligent Home Wi-Fi Solutions | ThinkPalm
 
Hot Sexy call girls in Patel Nagar🔝 9953056974 🔝 escort Service
Hot Sexy call girls in Patel Nagar🔝 9953056974 🔝 escort ServiceHot Sexy call girls in Patel Nagar🔝 9953056974 🔝 escort Service
Hot Sexy call girls in Patel Nagar🔝 9953056974 🔝 escort Service
 
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024
 
Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)
 
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed DataAlluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
 
Building Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop SlideBuilding Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
 
chapter--4-software-project-planning.ppt
chapter--4-software-project-planning.pptchapter--4-software-project-planning.ppt
chapter--4-software-project-planning.ppt
 
Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...
Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...
Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...
 
Implementing Zero Trust strategy with Azure
Implementing Zero Trust strategy with AzureImplementing Zero Trust strategy with Azure
Implementing Zero Trust strategy with Azure
 
Salesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantSalesforce Certified Field Service Consultant
Salesforce Certified Field Service Consultant
 
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdfGOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
 
Recruitment Management Software Benefits (Infographic)
Recruitment Management Software Benefits (Infographic)Recruitment Management Software Benefits (Infographic)
Recruitment Management Software Benefits (Infographic)
 
Cloud Data Center Network Construction - IEEE
Cloud Data Center Network Construction - IEEECloud Data Center Network Construction - IEEE
Cloud Data Center Network Construction - IEEE
 
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
 
Cloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStackCloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStack
 
Professional Resume Template for Software Developers
Professional Resume Template for Software DevelopersProfessional Resume Template for Software Developers
Professional Resume Template for Software Developers
 
英国UN学位证,北安普顿大学毕业证书1:1制作
英国UN学位证,北安普顿大学毕业证书1:1制作英国UN学位证,北安普顿大学毕业证书1:1制作
英国UN学位证,北安普顿大学毕业证书1:1制作
 

REST and Resource Oriented Architecture - okcDG March 2008

  • 1. REST and Resource Oriented Architecture okcDG March 2008 Ryan Hoegg Valtech Technologies
  • 2. REST, ROA, and Web Services Architectural style of the WWW One way to build RESTful web services Not very well defined REST: ROA: Web Services:
  • 3. So what is “Web Services”? ...hem hem haw hem haw... What they said <shrug/> Here's some software. They're great! Buy our tools! W3C: Wikipedia: Apache: Microsoft:
  • 4. So what is “Web Services”?? Software services deployed on the WWW intended for use by other software components
  • 5. What is REST? Architectural style for distributed hypermedia systems Behind the architecture of the WWW Described in “Architectural Styles and the Design of Network-based Software Architectures” by Roy T. Fielding
  • 6. Software Architecture A set of rules about the components, connectors, and data in a software system intended to induce some desired properties. “...A software architecture is an abstraction of the run-time elements of a software system during some phase of its operation.” --Roy T. Fielding
  • 7. Architectural Style “a set of rules that an architecture should conform to” -- from the RestWiki “...a coordinated set of architectural constraints that restricts the roles/features of architectural elements and the allowed relationships among those elements within any architecture that conforms to that style.” -- Roy T. Fielding
  • 9. Resource? Any information or concept that can be named. The key abstraction of information in REST
  • 10. Representation The information about a resource that is transmitted across the network.
  • 11. Addressability A resource identifier should represent only one resource.
  • 12. Statelessness The server never stores any application state. Each request can be considered in isolation.
  • 13. “Connectedness” The server includes levers of state in the representations it sends to the client.
  • 14. Uniform Interface Resources share interface characteristics. For example: methods, identifiers, data types
  • 15. What does it buy me? Large surface area Scalable and Reliable Easy to use and Robust Transparent and Reliable Addressable = Stateless = Connected = Uniform =
  • 16. Where REST came from CERN – ENQUIRE project MOMSpider and libwww-perl mailing list for NCSA httpd becomes the Apache HTTPD Project REST guides the architecture of the WWW, and the WWW serves as a testbed for the ideas behind REST 1990-1992: 1993-1994: 1994-1995: 1995-now:
  • 17. REST on the Web URI HTTP Hypermedia
  • 18. URI Uniform Resource Identifier Provides addressability of resources e.g. http://okcpro.net/Events/MeetingsEvents/tabid/60/Default.aspx
  • 19. Hypermedia? Hypertext is text with links and forms. Hypermedia expands this to include other representations such as SVG.
  • 20. HTTP GET /Events/MeetingsEvents/tabid/60/Default.aspx HTTP/1.1 Host: okcpro.net HTTP/1.1 200 OK Date: Mon, 10 Mar 2008 05:10:43 GMT ... Content-Type: text/html <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 ... <html lang="en-US"> <head> ... <title>Meetings and Events</title>...
  • 21. HTTP Methods Retrieve a resource Retrieve resource metadata Determine the methods supported by a resource Create or update a resource Destroy a resource Create a new subordinate resource GET HEAD OPTIONS PUT DELETE POST
  • 22. Safety A safe request does not change resource state
  • 23. Idempotence An idempotent request has the same effect if it succeeds once or more than once
  • 24. HTTP Response Codes A set of standardized codes that describe the outcome of an HTTP request. 100-199: Informational 200-299: Success 300-399: Redirection 400-499: Client error 500-599: Server error
  • 25. HTTP Headers Metadata about an HTTP request or response. Some headers are control metadata, while others are resource metadata.
  • 26. Resource Oriented Architecture “...a set of concrete rules for building web services that really will be RESTful” --Richardson and Ruby, “RESTful Web Services”
  • 27. Resource Oriented Architecture Method information: What should the service do in response to this request? This is the HTTP method.
  • 28. Resource Oriented Architecture Scoping information: On what data should the service operate? This belongs in the URI.
  • 29. ROA Oversimplified 1. Figure out the data set 2. Split the data into resources For each kind of resource: 3. Name the resources with URIs 4. Expose a subset of the uniform interface 5. Design the representation(s) accepted from the client 6. Design the representation(s) served to the client 7. Integrate this resource into the others, using links and forms 8. What's supposed to happen? 9. What might go wrong? Adapted from “RESTful Web Services”, by Richardson and Ruby
  • 31. http://www.decentpizza.com/ A simple pizza delivery web service Cool domain name huh?
  • 32. http://www.decentpizza.com/ A simple pizza delivery web service There's a squatter in Ohio who thought so.
  • 33. Some User Stories Menu Current Specials Place Order Check Order Status Cancel Order
  • 34. 1. Figure out the data set a menu of pizzas, sides, and toppings which have a photo, a price, and a description a special has a discounted price for one or more menu items, and will expire. an order has a creation time, a total price, a delivery address, a status, and one or more menu items
  • 35. 2. Split the data set into resources a menu a pizza, identified by name a side, identified by name the list of available pizza toppings a topping, identified by name the list of current specials a special an order
  • 36. 3. Name the resources with URIs the menu: http://www.decentpizza.com/menu a pizza: http://www.decentpizza.com/menu/pizza/{name} a side: http://www.decentpizza.com/menu/side/{name} the list of toppings: http://www.decentpizza.com/menu/toppings a topping: http://www.decentpizza.com/menu/topping/ {name} the list of current specials: http://www.decentpizza.com/menu/specials a special: http://www.decentpizza.com/menu/special/ {id} an order: http://www.decentpizza.com/orders/{id}
  • 37. 4. Expose a subset of the uniform interface For the menu and below: GET, HEAD, and OPTIONS To place an order: POST http://www.decentpizza.com/orders To check order status: GET http://www.decentpizza.com/orders/{id} To cancel an order: DELETE http://www.decentpizza.com/orders/{id}
  • 38. 5. Design the representation(s) accepted from the client Placing an order:
  • 39. 6. Design the representation(s) served to the client The menu:
  • 40. 6. Design the representation(s) served to the client An order:
  • 41. 7. Integrate this resource with other resources using links and forms When the client GETs an order, it includes a form that describes how to cancel it:
  • 42. 8. What's supposed to happen? For the menu and below: GET, HEAD, and OPTIONS Response Code: 200 (OK) POST http://www.decentpizza.com/orders : Response Code: 201 (Created) Location: http://www.decentpizza.com/orders/{new id} GET http://www.decentpizza.com/orders/{id}: Response Code: 200 (OK) DELETE http://www.decentpizza.com/orders/{id}: Response Code: 200 (OK)
  • 43. 9. What might go wrong? The client may try to access a menu item or special that doesn't exist, like /menu/drinks/margarita 404 (“Not Found”)
  • 44. 9. What might go wrong? The client might try to cancel an order that's already been cancelled 404 (“Not Found”)
  • 45. 9. What might go wrong? The client might POST an order that my service doesn't understand 400 (“Bad Request”)
  • 46. 9. What might go wrong? My ordering back end might be down 500 (“Internal Server Error”)
  • 47. Where to learn more The RestWiki Roy T. Fielding's dissertation RESTful Web Services (book) The World Wide Web (surprised?)

Editor's Notes

  1. 1. (W3C paraphrased) Programmatic interfaces made available for application to application communication on the World Wide Web 2. (W3C quote) Web services provide a standard means of interoperating between different software applications, running on a variety of platforms and/or frameworks. 3. (Wikipedia paraphrased) clients and servers that communicate using XML messages that follow the SOAP standard, optionally using WSDL to describe interfaces. 4. xml.com quoting IBM: self-contained, self-describing, modular applications that can be published, located, and invoked across the Web. 5. RestWiki: distributed computing using web standards wherein the data being exchanged is designed for machine consumption rather than human consumption.
  2. “Big Web Services” include SOAP, WSDL, WS-*
  3. “The intended conceptual target of a hypertext reference” -- Roy T. Fielding
  4. Any useful information about a resource&amp;apos;s current state.
  5. Guides the client in changing resource or application state.
  6. Addressable: Everything interesting about your service is immediately accessible from the outside Stateless: Load balancing, retries, caching Connected: Easy to figure out what it does and how to use it. Even when you change those things. Uniform Interface: Easy to figure out again, and also allows intermediaries to understand each request at a deeper level. Reduces coupling between components. “REST provides a set of architectural constraints that, when applied as a whole, emphasizes scalability of component interactions, generality of interfaces, independent deployment of components, and intermediary components to reduce interaction latency, enforce security, and encapsulate legacy systems.” -- Fielding Also, supports gradual and fragmented deployment of changes within an already deployed architecture.
  7. The World Wide Web began as a CERN project called ENQUIRE, initiated by Tim Berners-Lee and Robert Cailliau in 1990. Berners-Lee and Cailliau were jointly honored by the ACM in 1995 for their contributions to the development of the World-Wide Web.
  8. Filesystem example component
  9. Contrast this with the architectural “process” used to automatically generate a SOAP-based web service and WSDL from java or .NET code. This is much more work for you. But it reduces work for each of your service consumers. And you get the benefits of uniform interface, addressability, statelessness, and connectedness.