Document Sample
REST Powered By Docstoc
					 Principled Design of the Modern
        Web Architecture
       Roy T. Fielding and Richard N Taylor

1.   Roy T. Fielding and Richard N. Taylor. ”Principled Design of the Modern Web Architecture.
     In Proc. 22nd International Conference on Software Engineering (ICSE'2000), pages 407-416,
     Limerick, Ireland, 4-11 June 2000. IEEE CS Press
2. (9 december 2002)
3. (9 december 2002)
4. (9 december 2002)
5. (9 december 2002)
REpresentational State Transfer
”REST is an abstract model of the web
architecture to guide our redesign and
definition of the Hypertext Transfer
Protocol and the Uniform Resource
Identifiers – the goal is to provide a model
of how the world wide web (web) should
work” (Fielding an Taylor 2000)
Fundamental issue – an example


                                    Course Material

 The user wants to fetch a webpage (resource) and does that by selecting a link (URL). In
 return the user gets a Representation of the resource (the course material in DIF 8914).
 The client application is now in a state holding a representation of the course material in
 DIF 8914. Within this file the user discover other links, and by selecting one of these the
 user changes the state of the client application (a representation of another resource is
 downloaded and rendered). between each resource representation the client application
 changes state (it transfers).  Representational State Transfer
      Important issues in REST
• Scalability of component interactions
   – Distributing, components, reducing server processing
• Generality of interfaces
   – All resources are accessed using a generic interface
     (http methods)
• Independent deployment of components
   – components can be connected dynamically (new clients
     to old servers, …)
• Intermediary components
   – reduce interaction latency, enforce security, encapsulate
     legacy systems
Fundamental architectural elements
• REST encompasses the fundamental
  constraints upon components, connectors,
  and data that define the basis of the Web
  architecture, and thus the essence of its
  behavior as a network-based application.
                  Data elements
Data Element            Modern Web Examples

resource                the intended conceptual target of a hypertext reference

resource identifier     URL, URN

representation          HTML document, JPEG image

representation metadata media type, last-modified time

resource metadata       source link, alternates, vary

control data            if-modified-since, cache-control
                        Connector types
”The connectors present an abstract interface for component communication”

All interactions are stateless            Connector         Modern Web Examples
1.   connectors need not retain state
                                          client      libwww, libwww-perl
     between requests
2.   interactions can be processed in     server      libwww, Apache API, NSAPI
                                          cache       browser cache, Akamai cache network
3.   intermediary can view and
     understand a request in isolation    resolver    bind (DNS lookup library)

4.   forces all info needed for caching   tunnel      SOCKS, SSL after HTTP CONNECT
     to be present
  Component types
(processing elements)

Component           Modern Web Examples

origin server Apache httpd, Microsoft IIS

gateway      Squid, CGI, Reverse Proxy

proxy        CERN Proxy, Netscape Proxy, Gauntlet

user agent   Netscape Navigator, Lynx, MOMspider
       Architectural views
For describing how the elements work
together to form an architechture
             Process view
• For eliciting the interaction relationship
  among components by revealing the path of
  data as it flows through the system
             Connector view
• Mechanics of the communication between
• Particularly interested in the constraints that
  define the generic resource interface
                Data View
• A data view of an architecture reveals the
  application state as information flows
  through the components
             Concluding remarks (1)
derived from (9 december 2002)

• Data elements are accessed through a
  standardized interface.
• Components communicate by transferring
  representations of resources through this
  interface rather than operating directly
  upon the resource itself.
• Connectors present an abstract interface
  for component communication, hiding the
  implementation details of communication
             Concluding remarks (2)
derived from (9 december 2002)

• Components use connectors to access,
  provide access or mediate access to
• All requests made to connectors must
  contain all the information necessary for
  the understanding of that request without
  depending on any previous request, i.e.
  they are stateless.
• It is important that intermediaries are an
  explicit aspect of the architecture and
  because of REST's characteristics, these
  intermediaries can be more than just

Shared By:
langkunxg langkunxg http://