Java Reference
In-Depth Information
▪ JSON
▪ XHTML
▪ JPEG image
Messages are self-describing
No out-of-band negotiation can be required to determine how to communicate with the ser-
vice.
RESTful architectures are built with resources
RESTful architectures are built through resources, each of which has its own unique URI.
A resource is an item that “might be the target of an author's hypertext reference” (section
5.2.1.1). The URI serves as the ID of the resource. Any information item that can be named
can be a resource. This could be a stock price at a given point in time, a purchase order, the
current weather in Scottsdale, and so on. Here are some examples:
http://soacookbook.com/customers
http://soacookbook.com/customers/1234
http://soacookbook.com/orders/456/customer
And here is a real-life example from Overstock.com, which was created with a RESTful ar-
chitecture:
http://www.overstock.com/Home-Garden/Tiffany-style-Table-Lamp/
2260849/product.html
This URI drills down through the category representing home and garden to the Tiffany-style
lamp subcategory to a particular product ID. From this page, you can get to help pages, cus-
tomer care pages, and more. The “View a Particular Product” state allows for transitions to
each of these other states.
RESTful identifiers may be long-lived and stable. Because of the use of URIs, everything that
matters to users in REST can be bookmarked, cut and pasted, or cataloged with RDF (Re-
source Description Framework) in a metadata model. Every unit of information carries its ad-
dress, and is wholly independent of the underlying framework or implementation producing
the API. That is, there is no domain-specific object or resources in view; clients simply act on
the representations they receive.
Hypermedia as the engine of application state
Hypertext is generally considered to be text that is interactive and nonlinear, that branches
and gives the reader a set of choices. Fielding's definition of hypertext does not simply mean
Search WWH ::




Custom Search