views:

105

answers:

5

I would like to know, what are the ways a web framework may be suitable for designing a RESTful app, in general.

One goal is for example to provide http request routing, so they are automatically sent to appropriate controllers. From architectural point of view, web framework based on MVC pattern are more suitable for REST.

What other features of web frameworks are helpful by building apps satisfying the REST constraints?

Is there any reason why you consider certain languages(python/java) or web frameworks(django/turbogears/jersey/restlets/...) as the most applicable ones?

A: 

There are few ways that a web framework can NOT support REST. Its basically written with the HTTP model in mind; so just about any web framework works. The automatic routing you mention is a common expectation, but not strictly required for REST.

Justin
I would say there is a significant difference when e.g. the frameworks allows to define restful resources with appropriate rest verbs and their implementations, like e.g. Ruby on Rails and its scaffolding.
Gabriel Ščerbák
While I agree with Justin's meaning, I think he's worded it confusingly. It's too easy to read it as if he is saying that web frameworks *can't* support REST, which is wrong!
Donal Fellows
+1  A: 

I think the best way for a web framework to support a RESTful style is to automatically map the different HTTP verbs (GET, POST, PUT, DELETE, etc.) to corresponding methods on its controllers/request handlers. Most modern Python web frameworks do this out of the box, with the notable exception of Django (unless I missed a dramatic change).

Will McCutchen
A: 

I would stress the ability to directly support definition of resources. In Ruby on RAils you can define a resource through scaffolding and you get a model with controller with restful verbs implemented also with views and support for different formats and readily avalaible views and routing with ids.

Aside from that having access to HTTP and supporting principles of HTTP is what you need.

I am not experienced enough to know about support in frameworks, but it would be also nice to have support for the caching and other request options.

Gabriel Ščerbák
A: 

On the “specific software recommendation” front, I've had people recommend Apache CXF as a framework for building RESTful services with Java. It appears to be even able to simultaneously support SOAP (which happens to be very useful for helping some of our customer base adopt the software). I'm still in the experimenting-with-it stage though, so you may be able to do better.

Donal Fellows
+1  A: 

a) You need very flexible routing.
b) You need to be able to easily generate links that correlate to resource controllers using templates and parameters.
c) The server should help you to parse all the http headers. e.g. Authorization headers, Accept headers, language headers, cookies, etags.
d) It should support serializing and deserializing all the commonly used mime types.
e) It should help parsing parameters from incoming URLs
f) It should help resolving relative urls based on the request url and any available BaseURL.

Darrel Miller