Download - Rest in design
REST IN DESIGN
@diego_pacheco
2000
#FACTS• 85% of Amazon services usage is of the REST interface• Google Deprecates Their SOAP Search API
Representational State Transfer
Roy Fielding
HTTP
POX + POST + HTTP = REST
POX + POST + HTTP = REST
RESOURCES
RESOURCES(Server thinks before
do)
Nouns or Verbs ?
Hypermedia
REST
Verbs + hm Media Types
ROA & WOA
Client Server
Client
Server
SOCUniform InterfacePortabilityScalable
Stateless
Stateless
(Stateful)
Client Server
Cacheable
Client Server
HTTP HEADERS(not only
uris)
HTTP METHODS
Idempotent
SAMPLE
BEYOND XML
MIME Typesapplication/octet-stream
text/html
text/plain
image/jpeg
application/json
application/x-excel…
HTTP RESPONSE CODES
JSR 311JAX-RS: The JavaTM API for
RESTful Web Services
ANNOTATIONS
@Path@Produces@Consumes
@GET@POST@PUT@DELETE@HEAD
@Context@PathParam@HeaderParam@CookieParam@QueryParam
WADL
GET /customers/1/order/2/price/2000/weight/2
Exceptions -> Error Code
Parameters
Filters
RESTful services without annotations
web.xml
Programmatically Exposure
ATOMPUB
HANDS ON
Pair Programming Exercise !
TOLL REST SERVICE
TOLL REST SERVICE
U$ 0.45
U$ 3.95 **
U$ 1.00
U$ 1.59U$ 2.11
Vehicle Taxes Rates
http://diegopacheco.svn.beanstalkapp.com/sandbox/trunk/toll-rest-service-pprog
REST IN DESIGN
@diego_pacheco
THANK YOU!