| By Kevin Hoffman | Article Rating: |
|
| August 24, 2008 04:30 AM EDT | Reads: |
3,702 |
First, let me apologize for my lack of posting. I've been really busy taking up to 4 night classes per week and I'm working on a super ultra-top-mega secret book project with a friend and colleague. The only hint I can drop is that the book is going to kick ass. Look for more details soon!
Now, on to REST. I don't need to go into too much detail here about what exactly REST is - I know that most of the readers of this blog are well versed in Web Services technologies and architectural patterns. The thing that I want to cover is that REST is an architectural decision, it is not a protocol or a wire format or even an industry standard. It is a set of recommendations for how you organize the information exposed by your Web Services. Before I go into detail here, I personally think that REST is the way to go. Unless you have a particular need to be strapped into the SOAP/WS-* roller coaster, your Web Service should be exposing resources via RESTful URLs. I can't imagine why people would chose not to do so.
Here's a quick summary of the main tenets of REST in case you're not familiar with the concept:
- Application state and functionality are both considered resources. This is key to RESTful thinking - everything is a resource. Learn that phrase, love it, and live it.
- Every resource is addressable through a unique URL. Fielding's original paper on REST only requires a universal syntax, but if we're talking about Web services here, the universal resource address syntax is a URL. Hint: URL stands for Uniform Resource Locator.
- Every resource in the system shares a uniform interface for the transfer of state between the client and the resource (a decent, but somewhat stretched analogy is that a resource is the server in a client/server scenario). This means that the list of operations possible on a given resource is well-defined, and the list of content types describing the state being transferred is also well-defined.
- HTTP already has a strict set of operations: PUT, GET, DELETE, POST (and optionally HEAD)
- HTTP also has a strict set of available content-types.
- Therefore, transferring state between RESTful URLs is ideally suited to being done over HTTP.
- According to Fielding (the first person to really put REST into the public eye), REST must be:
- Client-Server
- Stateless
- Cacheable
- Layered. This means that connected components within a system are unable to "see past" that which they are currently doing. A properly layered framework means that a layer can only see the 1 layer immediately below it, and no others.
I could attempt to summarize why I like REST so much, but instead there's a quote from Fielding's paper (which I believe is also in Wikipedia) that does the job way better than I could:
REST’s client-server separation of concerns simplifies component implementation, reduces the complexity of connector semantics, improves the effectiveness of performance tuning, and increases the scalability of pure server components. Layered system constraints allow intermediaries—proxies, gateways, and firewalls—to be introduced at various points in the communication without changing the interfaces between components, thus allowing them to assist in communication translation or improve performance via large-scale, shared caching. REST enables intermediate processing by constraining messages to be self-descriptive: interaction is stateless between requests, standard methods and media types are used to indicate semantics and exchange information, and responses explicitly indicate cacheability.
Before getting into the example, I feel the need to again state that REST is not a wire format. You cannot compare REST to SOAP, or REST to POX, or REST to JSON. They are not the same type of animal nor do they solve the same kinds of problems. REST is an architecture for designing distributed applications that calls for universally and uniquely addressable resources.
Published August 24, 2008 Reads 3,702
Copyright © 2008 SYS-CON Media, Inc. — All Rights Reserved.
Syndicated stories and blog feeds, all rights reserved by the author.
More Stories By Kevin Hoffman
Kevin Hoffman, editor-in-chief of SYS-CON's iPhone Developer's Journal, has been programming since he was 10 and has written everything from DOS shareware to n-tier, enterprise web applications in VB, C++, Delphi, and C. Hoffman is coauthor of Professional .NET Framework (Wrox Press) and co-author with Robert Foster of Microsoft SharePoint 2007 Development Unleashed. He authors The .NET Addict's Blog at .NET Developer's Journal.
- IBM Puts Systems Chief on Leave of Absence
- Amazon Web Services Database in the Cloud
- SpringSource Moving to Spring 3.0
- Virtualization Expo Call for Papers Deadline December 15
- Move Over BI, Here Comes PI - Performance Intelligence
- Using Ext JS, Servlets, JSON, MySQL and Tomcat on Fedora
- Qt DevDays 2009 - Munich
- Developing APIs for the Cloud
- Canonical Offers Free Cloudware
- New-Generation Virtualization Technologies with Ultra Low-Cost Endpoints
- The Planet Executive to Speak at Cloud Computing Conference
- Trusting the Cloud
- Oracle-Sun: IBM Reportedly Behind Delay
- The Case for Single-Purpose Services
- IBM Puts Systems Chief on Leave of Absence
- Cloud BI & Amazon VPC
- Cloud-Oriented Switch Start-up Valued at $230M
- The Curious Case of Build Release Management eBook
- Amazon Web Services Database in the Cloud
- Tips for Efficient PaaS Application Design
- Reporting Solutions Using Crystal Reports for Eclipse
- SpringSource Moving to Spring 3.0
- Virtualization Expo Call for Papers Deadline December 15
- Un-Clouding Federal Security Compliance
- Java Developer's Journal Exclusive: 2006 "JDJ Editors' Choice" Awards
- The i-Technology Right Stuff
- Creating Web Applications with the Eclipse Web Tools Project
- Eclipse Special: Remote Debugging Tomcat & JBoss Apps with Eclipse
- The Next Programming Models, RIAs and Composite Applications
- Where Are RIA Technologies Headed in 2008?
- How to Bring Eclipse 3.1, J2SE 5.0, and Tomcat 5.0 Together
- SYS-CON Webcast: Eclipse IDE for Students, Useful Eclipse Tips & Tricks
- Eclipse: The Story of Web Tools Platform 0.7
- "Eclipse 3.0 is a Great Leap Forward," Says JDJ's Dudney
- Developing an Eclipse BIRT Report Item Extension
- The Top 250 Players in the Cloud Computing Ecosystem




























