Enterprise Integration Zone is brought to you in partnership with:

Bradley Holt is a web developer, entrepreneur, community facilitator, speaker, and an author. He is the co-founder of Found Line, a creative studio with capabilities in web development, web design, and print design. He is a Board Member at Vermont Community Access Media, a non-profit community media and technology center. He is a minor contributor of source code and bug reports to Zend Framework and an active member of the PHP community. He organizes the Burlington, Vermont PHP Users Group where he is a regular speaker and is involved with helping to organize other technology community events such as Vermont Code Camp. He has spoken at (or will be speaking at) SXSW Interactive, OSCON, OSCON Data, the jQuery Conference, and ZendCon. He is the author of Writing and Querying MapReduce Views in CouchDB and Scaling CouchDB, both published by O’Reilly Media. He blogs at bradley-holt.com and can be found on Twitter as @BradleyHolt. Bradley is a DZone MVB and is not an employee of DZone and has posted 17 posts at DZone. You can read more from them at their website. View Full User Profile

Defining a RESTful Framework

03.02.2012
| 9513 views |
  • submit to reddit

Web application frameworks have varying support for the concepts behind Representational State Transfer (REST). Most web application frameworks, if not all, allow you to create “fully” RESTful web applications. However, there does not seem to be a focus on explicitly applying RESTful principles. So, here are the key concepts that I’d like to see addressed:

 

  • Embrace, and don’t abstract, the Hypertext Transfer Protocol (HTTP).
  • Focus on entities/resources—identified by full Uniform Resource Identifiers (URIs).
  • Use HTTP methods (GET, POST, PUT, DELETE, OPTIONS, HEAD) to perform operations on entities/resources.
  • Allow for self-described messages through the use of header fields, such as Accept and Content-Type.
  • Make hypermedia controls a core concept (perhaps using PHACTOR as a starting point), not just a byproduct of rendering.
  • Think of web applications as state transition systems. Representations of entities/resources are states, and hypermedia controls define the available state transitions.

Benefits:

  • Interoperability: Focusing on open standards allows for easier integration with other systems.
  • Cacheability: Embracing HTTP gives you many caching options, almost for free.
  • Testability: Self-contained and self-describing messages are very testable. Decomposing a complex system into states and available state transitions greatly reduces the complexity of the system and its tests.

Source: http://bradley-holt.com/2011/08/defining-a-restful-framework/

Published at DZone with permission of Bradley Holt, author and DZone MVB.

(Note: Opinions expressed in this article and its replies are the opinions of their respective authors and not those of DZone, Inc.)

Comments

Goel Yatendra replied on Thu, 2012/03/15 - 2:41pm

It’s funny you made this post. I was just talking about this a lunch. I have a side project I have been working on to do just that, embrace HTTP instead of ignore it. I can’t believe (in PHP at least) that after all of these years there isn’t a single framework that uses what HTTP already gives us in terms on content negotiation, etc.

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.