Moving Beyond Methods in REST
While there’s a nice internal logic to mapping HTTP methods to object methods, it doesn’t realise the power of having generic semantics.
While I agree there's a lot to be improved in existing HTTP APIs, I'm not sure this is the most pressing problem. I'd rather somebody bring up some ideas on how to exploit the hypermedia aspects ...
Low-hanging fruit first… :)
Fair enough :-)
Something I’d like to see more discussions is Resource Transformations. When you’re developing RESTFul services that go somewhat beyond CRUD, you might have several resource transformations.
When a given resouce changes to or from some state, there might be transformations on other resources. For example, let’s think of some Amazon sales process where you have Item and Order resources and several related resources like billing and logistics stuff. When the user pays for the Order, some transformation in billing resources would apply a transformation to the Order resource, changing its state to “paid”
When the Order resource has its state changed to “paid”, we could have transformations applied to logistics resources, telling the delivery system to deliver the order.
This kind of resource transformations appear a lot when you’re developing RESTFul services that are more than CRUD. I think a very good approach to solve this is using finite state machines, defining what resource states we have and what happens in every meaningful state transition.
I’d like to see more discussion about this kind of things, because resource transformations might be very tricky, and complex RESTFul services definitely need them.