Tuesday, July 28, 2009

webmachine: intriguing

A few days ago, rjbs pointed me at Webmachine, "a REST-based system for building web applications".

Its central concept is a pretty mind-blowing inversion of control compared to I'm used to in Catalyst-Action-REST. Webmachine says that there's only one way to handle a request to a particular resource. That means that you don't write any of the logic to decide what status code to return -- you write a bunch of hooks that let Webmachine decide it for you. Similarly with content type (both request and response), etag, etc. -- here's the full list.

Webmachine's still sinking into my brain, so I haven't gotten my mind around how it might be done in Perl, let alone how it'd fit into something like Catalyst -- Webmachine also has a URL dispatching mechanism, but it seems to be almost entirely separable from the resource dispatching mechanism (the HTTP graph, above). I'm looking forward to playing around with these ideas more, though, because Webmachine seems to solve a few of the architectural problems I was having with C-A-REST.

No comments:

Post a Comment