Web Services
  Home arrow Web Services arrow Page 5 - Safety, Idempotence, and the Resource-Orie...
Dev Articles Forums 
ADO.NET  
Apache  
ASP  
ASP.NET  
C#  
C++  
ColdFusion  
COM/COM+  
Delphi-Kylix  
Design Usability  
Development Cycles  
DHTML  
Embedded Tools  
Flash  
Graphic Design  
HTML  
IIS  
Interviews  
Java  
JavaScript  
MySQL  
Oracle  
Photoshop  
PHP  
Reviews  
Ruby-on-Rails  
SQL  
SQL Server  
Style Sheets  
VB.Net  
Visual Basic  
Web Authoring  
Web Services  
Web Standards  
XML  
Mobile Linux 
App Generation ROI 
IBM® developerWorks 
Weekly Newsletter
 
Developer Updates  
Free Website Content 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us Get Paid 
Request Media Kit
Contact Us 
Site Map 
Privacy Policy 
Support 
 USERNAME
 
 PASSWORD
 
 
  >>> SIGN UP!  
  Lost Password? 
WEB SERVICES

Safety, Idempotence, and the Resource-Oriented Architecture
By: O'Reilly Media
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 5 stars5 stars5 stars5 stars5 stars / 1
    2009-02-20

    Table of Contents:
  • Safety, Idempotence, and the Resource-Oriented Architecture
  • Safety and Idempotence
  • Why safety and idempotence matter
  • Why the Uniform Interface Matters
  • That’s It!

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      Del.ici.ous Digg
      Blink Simpy
      Google Spurl
      Y! MyWeb Furl
    Email Me Similar Content When Posted
    Add Developer Shed Article Feed To Your Site
    Email Article To Friend
    Print Version Of Article
    PDF Version Of Article
     
     
    ADVERTISEMENT


    Safety, Idempotence, and the Resource-Oriented Architecture - That’s It!


    (Page 5 of 5 )

     

    That’s the Resource-Oriented Architecture. It’s just four concepts:

    1. Resources
    2. Their names (URIs)
    3. Their representations
    4. The links between them

    and four properties:

    1. Addressability
    2. Statelessness
    3. Connectedness
    4. A uniform interface

    Of course, there are still a lot of open questions. How should a real data set be split into resources, and how should the resources be laid out? What should go into the actual HTTP requests and responses? I’m going to spend much of the rest of the book exploring issues like these.

     


     

    * The earliest instance of “resource-oriented” I’ve found is a 2004 IBM developerWorks article by James Snell: “Resource-oriented vs. activity-oriented Web services” (http://www128.ibm.com/developerworks/xml/
    library/ws-restvsoap/). Alex Bunardzic used “Resource-Oriented Architecture” in August 2006, before this book was announced: http://jooto.com/blog/index.php/2006/08/08/replacing-service-oriented-architecture-with
    -
    resource-oriented-architecture/
    . I don’t agree with everything in those articles, but I do acknowledge their priority in terminology.

    † “The Architecture of the World Wide Web” (http://www.w3.org/TR/2004/REC-webarch-20041215/#p39), which is full of good quotes, incidentally: “Software developers should expect that sharing URIs across applications will be useful, even if that utility is not initially evident.” This could be the battle cry of the ROA.

    ‡ Compare the Ajax interface against the more addressable version of Gmail you get by starting off at the URI
    https://mail.google.com/mail/?ui=html. If you use this plain HTML interface, the resource “email messages about jellyfish” is addressable.

    § Other consumers of this web service include the libgmail library for Python (http://libgmail.sourceforge.net/).

    ‖ This idea is based on the CMU Coke machine (http://www.cs.cmu.edu/%7Ecoke/), which for many years was observed by instruments and whose current state was accessible through the Finger protocol. The machine is still around, though at the time of writing its state was not accessible online.

    #Multiplying a number by one is both safe and idempotent: 4 ×1 ×1 ×1 is the same as 4 ×1, which is the same as 4. Multiplication by zero is not safe, because 4 ×0 is not the same as 4. Multiplying by any other number
    is neither safe nor idempotent.


    DISCLAIMER: The content provided in this article is not warranted or guaranteed by Developer Shed, Inc. The content provided is intended for entertainment and/or educational purposes in order to introduce to the reader key ideas, concepts, and/or product reviews. As such it is incumbent upon the reader to employ real-world tactics for security and implementation of best practices. We are not liable for any negative consequences that may result from implementing any information covered in our articles or tutorials. If this is a hardware review, it is not recommended to open and/or modify your hardware.

       · This article is an excerpt from the book "RESTful Web Services," published by...
     

    Buy this book now. This article is excerpted from chapter four of the book RESTful Web Services, written by Leonard Richardson and Sam Ruby (O'Reilly, 2008; ISBN: 0596529260). Check it out today at your favorite bookstore. Buy this book now.

    WEB SERVICES ARTICLES

    - Safety, Idempotence, and the Resource-Orient...
    - The Resource-Oriented Architecture in Action
    - Features of the Resource-Oriented Architectu...
    - The Resource-Oriented Architecture
    - Getting Started with Flex
    - Automated Billing and Faxing for the Web
    - An Introduction to Web Services
    - The Foundations of Web Services: From Novice...
    - Web Services Reengineering: Finishing Touches
    - Fault Handling with Web Services
    - Flow and Web Services
    - Process Lifecycles and Web Services
    - Business Processes and Web Services
    - Orchestrating Web Services
    - Notifications and Resources in the WS-Resour...







    © 2003-2009 by Developer Shed. All rights reserved. DS Cluster 5 Hosted by Hostway
    For more Enterprise Application Development news, visit eWeek