I have just started experimenting with Webmachine, an Erlang, well, REST framework for lack of anything better to call it.
I think what it does is best explained with the diagram
.
All you do is write functions that fill in the decision points in the diagram if necessary (the defaults are mostly sane), and write a list of dispatch points (pattern matches against the URL in effect). Compared to other REST frameworks such as Rack or WSGI it is much more complete, as it fills in a lot more of the work you need to do, rather than just providing a way to pass back return codes, headers and bodies like many other libraries do. (To be fair some of these add other framework bits of functionality).
I really like this – it certainly seems the right way to go about the process, and to support the application developer, and I think it is worth a look even if you are not particularly interested in programming in Erlang.
Oh and it can draw you trace pictures of the progress of your requests through the state diagram, which is rather cool too.