introducing rest
TRANSCRIPT
Introducing RESTIntroducing REST
Dong LiuDept. of Computer ScienceUniv. of [email protected]
http://blogs.usask.ca/dong_notes/
Jan. 8 2008Jan. 8 2008 Dong LiuDong Liu
AgendaAgenda
� What is REST � RESTful services� Comparing RESTful and SOAP-based approaches
� Useful resources
Jan. 8 2008Jan. 8 2008 Dong LiuDong Liu
RESTREST
� Representational State Transfer � The term comes from Roy Fielding’s PhD work� More practical than theoretical
� It is an architectural style, not a technology, nor an architecture � Software architecture = {Elements, Constraints, Rationale} *
� An architectural style abstracts elements and constraints from various specific architectures *
� Analogy: designs and design pattern
* Perry & Wolf "Foundations for the study of software architecture," SIGSOFT Softw. Eng. Notes. ACM, vol. 17, pp. 40-52, 1992.
Jan. 8 2008Jan. 8 2008 Dong LiuDong Liu
Deriving RESTDeriving REST
from Roy T. Fielding "Architectural styles and the design of network-based software architectures," University of California, Irvine, 2000.
RR: replicated repository$: cache CS: client-server LS: layered system S: stateless VM: virtual machine COD: code on demand U: uniform interface
Jan. 8 2008Jan. 8 2008 Dong LiuDong Liu
Uniform interfaceUniform interface
� Resources are identified by ONE resource identifier mechanism
� Access methods are the same for all resources
� Resources are manipulated by exchanging representations
� Representations are in self-descriptive messages
� Hypermedia acts as the engine of application state
Jan. 8 2008Jan. 8 2008 Dong LiuDong Liu
REST rationaleREST rationale
� Maximize reuse� Minimize coupling � Eliminate partial failure condition � Scale without bound� Simplify
from Roy T. Fielding "The Rest of REST," RailsConf Europe, 2007.
Jan. 8 2008Jan. 8 2008 Dong LiuDong Liu
Generic process to design RESTful servicesGeneric process to design RESTful services
1. Identify resources2. Design URIs3. Expose a subset of the uniform interface 4. Design the representations from and to the
client5. Integrate this resource into existing
resources, using hypermedia links and forms6. Consider typical flows 7. Consider error conditions A revised version of P216 in Leonard Richardson & Sam Ruby "RESTful Web Services," O'Reilly, 2007.
Jan. 8 2008Jan. 8 2008 Dong LiuDong Liu
RESTful design of del.icio.us services (1)RESTful design of del.icio.us services (1)
The example comes from Leonard Richardson & Sam Ruby "RESTful Web Services," O'Reilly, 2007.
Jan. 8 2008Jan. 8 2008 Dong LiuDong Liu
RESTful design of del.icio.us services (2)RESTful design of del.icio.us services (2)
Jan. 8 2008Jan. 8 2008 Dong LiuDong Liu
RESTful design of del.icio.us services (3)RESTful design of del.icio.us services (3)
Jan. 8 2008Jan. 8 2008 Dong LiuDong Liu
WS stackWS stack
from http://www.innoq.com/resources/ws-standards-poster/
Jan. 8 2008Jan. 8 2008 Dong LiuDong Liu
Interoperability?Interoperability?
Support for the Basic Profile is the baseline for interoperable Web services. Customers should demand that all of their Web services-enabled technology be compliant with the Basic Profile, and that in turn will lay the foundation for Web services to fulfill their promise and provide technology independentinteroperability.
Dan Sholler, Gartner from http://www.ws-i.org/Default.aspx
Jan. 8 2008Jan. 8 2008 Dong LiuDong Liu
WSWS--BabelBabel
from http://www.flickr.com/photos/psd/1805565187/in/set-72157602805227511/
Jan. 8 2008Jan. 8 2008 Dong LiuDong Liu
WSWS--AddressingAddressing
from http://www.flickr.com/photos/psd/406077535/in/set-72157602131510927/
Jan. 8 2008Jan. 8 2008 Dong LiuDong Liu
The Web is agreement The Web is agreement
from http://www.archive.org/details/TheWebIsAgreement
Jan. 8 2008Jan. 8 2008 Dong LiuDong Liu
The communityThe community
� Yahoo rest-discuss group � Steve Vinoski � Paul Downey� Sam Ruby� Bill de hÓra � Joe Gregorio� Mark Nottingham� Pete Lacey� Stefan Tilkov� Stuart Charlton� Mark Baker � …