12/12/07 :: [REST] Not even a scratch [permalink]
Assaf responded to my posts with the title "Ok, I'll bite".
Higher up the stack we find things like RESTful BPEL. RESTful BPEL is one particular way to express those higher level state transitions, like “let’s go from pending to approved”. It lets you say things like “this GET returns ‘pending’, and so the next PUT allows changing to ‘approved’ or ‘rejected’”. That sort of things, which I guess is what JJD is talking about.
Yes, this is exactly what I am talking about. I have absolutely no problem to think that at any given time the resource representation is only able to expose the subset of actions that are allowed at the current state. After this is what happens every day in billions of pages and users have no problem selecting the correct action, because they are human. This is how I interpret that REST is managing the application state via resource representation.
Now take the human out of the loop? How a software agent acting as a resource representation consumer would make sense of these actions if there was "no shared understanding" defined a priori.
So Assaf turns around and say
Resources exposed via well-groomed endpoints and entities work, I hope we’re all in agreement with that. Unfortunately, it works in a world of application silos closed off by WSDL service definitions.
Again, can someone in the REST camp tell me how "a resource representation consumer would make sense of these actions if there was "no shared understanding" defined a priori." I have had a discussion with a hard core RESTifarian for several weeks now, and he has postponed answering that very question. We are down to it now, this is the last point we need to clear up, everything else is clear. Again, with a human in the loop, it all works magically and this is what gave us the web as we know it.
So I am becoming a bit impatient to get the answer (of course I know the answer) and I would like to hear it from a RESTifarian. Somehow, Assaf, gives out the answer inadvertently before returning to the traditional REST blablabla:
RESTful resources are in charge of their location, operations you can do against them, and their representation. Operations go beyond four verbs, that’s the very essence of responses returning even more URLs.
He admits that the resource interface is not uniform and he tells us how "additional" operations are expressed as URL, cool stuff, but when no human is in the loop, you need a shared understanding between the resource consumer and the resource (provider). You pick your favorite method to express this shared understanding:
- an email exchanged by developers
- a blog post
- a WSDL or WADL
So go ahead, guys, make my day, answer the question...so we can all stop wasting our time.