views:

104

answers:

7

What are the main patterns and/or attributes that make an application RESTful?

A: 

A plain MVC partterns is good.

Also you have to make sure you split your things into real model (for example for a blog it would be post/comments)

Also you have to use all the HTTP verb so PUT/DELETE/POST/GET.

RageZ
A: 

I think this might answer your question: Representational State Transfer

Cem Kalyoncu
+2  A: 

Doing things RESTfully is actually hard.

At the end of the day, the big attributes are:

1 - URIs represent resources, not actions 2 - HTTP verbs describe what action to take

ie:

GETing http://www.example.com/something/1 will return the something identified by 1 POSTing http://www.example.com/something/1 will update it PUTing http://www.example.com/something will create a new something

3 - The responses to things like GET requests should document other places the client can go.

If a client asks for http://www.example.com/movies/1 (via GET), the response should contain elements that point the client to things related. Like http://www.examples.com/review/movie/1 (which might list reviews of movie #1

This is really rough -- spend a day googling around and reading. Then try to figure out who's really talking about REST, and who's confusing it with basic RPC stuff with simplified URL schemes.

timdev
It seems that POSTing to http://www.example.com/something/1 will create a subordinate of 'something' identified by 1, i.e. POST treats 'something' as a collectionPUTing http://www.example.com/something will replace the collection of 'something' with a new collectionthere's a table in http://en.wikipedia.org/wiki/Representational_State_Transfer#RESTful_web_services which explains different combinations of URIs and methods
Boris Pavlović
+1  A: 

To start with, a RESTful web service must not violate any of the following constraints (described in detail in Roy Fielding's seminal dissertation):

  • client-server
  • stateless
  • cacheable
  • uniform interface
  • layered system

Of these, 'uniform interface' is particularly important.

Brandon E Taylor
A: 

A fundamental consideration in REST is to strictly observe the division between "side effect free" methods and ones with side-effects.

jldupont
A: 
  1. Understanding the difference between PUT and POST, aka understanding what idempotency means.

  2. REST != RPC. There seems to be a lot of resources on the web (such as this one) that seems to think that just because there are multiple representations of a resource, then it is restful. Links such as /API/User/GetUser are not restful.

Blake Pettersson
A: 

Hypermedia as the Engine of Application State (HATEOAS). Interpreting REST with a clear grasp of this single constraint will make everything else about REST an order of magnitude easier to understand.

Rich Apodaca