Ian Robinson considers that programming for the web requires a different architectural approach than for applications: clients are interested only in URIs, clients are responsible for the integrity of a sequence of requests, and one should implement application protocols as protocol resources , not domain resources.
Ian Robinson (http://iansrobinson.com) is a Principal Consultant with ThoughtWorks, where he specializes in the design and delivery of service-oriented and distributed systems. He has written guidance for Microsoft on implementing integration patterns, and has published articles, most recently in The ThoughtWorks Anthology. He is currently co-authoring a book on RESTful enterprise integration.
QCon is a conference that is organized by the community, for the community.The result is a high quality conference experience where a tremendous amount of attention and investment has gone into having the best content on the most important topics presented by the leaders in our community.QCon is designed with the technical depth and enterprise focus of interest to technical team leads, architects, and project managers.
What's wrong with having to peer inside the body?
if (body has this)
else if (body has that)
else if (body has the other)
//the other stuff
else if (etc ...
Instead think of separating each of those state checks in separate controllers each referenced by a single URI. For every "if else" you may need another resource. In this way the URI act as a type of router, automatically routing the resource you are changing to the right controller.
A direct side effect of this is easier to understand code, greater decoupling, and in my opinion less bugs created by trying to wrap your minds around all those if statements.
This video is a very good treatment on resource oriented design and Rest.
Did he just make stuff up.
Re: What's wrong with having to peer inside the body?
In that case, the handler looks up an unmarshaller keyed by the content type of the body, uses the unmarshaller to turn the bitstream of the body into a running object, tells the object to act. and the object does whatever it does.
Unmarshaller unmarshaller = unmarshallers.lookUp(request.contentType);
PostAction action = unmarshaller.unmarshall(request.body);
Re: Did he just make stuff up.
... The ..\Order\123 GET should get a resource named 123, ..\Order PUT, creates a resource, ..\Order\123 POST should modify the order. Period. ...