Over a million developers have joined DZone.
{{announcement.body}}
{{announcement.title}}

Defining a RESTful Framework

DZone's Guide to

Defining a RESTful Framework

· Database Zone
Free Resource

Download the Guide to Open Source Database Selection: MySQL vs. MariaDB and see how the side-by-side comparison of must-have features will ease the journey. Brought to you in partnership with MariaDB.

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/

Interested in reducing database costs by moving from Oracle Enterprise to open source subscription?  Read the total cost of ownership (TCO) analysis. Brought to you in partnership with MariaDB.

Topics:

Opinions expressed by DZone contributors are their own.

THE DZONE NEWSLETTER

Dev Resources & Solutions Straight to Your Inbox

Thanks for subscribing!

Awesome! Check your inbox to verify your email so you can start receiving the latest in tech news and resources.

X

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}