Protocol Building

August 24, 2007

In a comment, Mike Glendinning (who really needs to get a blog of his own) challenges my claim that you end up building your own protocol when using web services instead of relying on an existing one when using RESTful HTTP.

As usual, I think Mike is right to a certain degree — when you build applications using RESTful HTTP approach, there is still a lot of application-specific behavior that is not defined by HTTP or REST. But there is a lot of application behavior that is part of the pre-defined protocol. Let’s take identification (URIs) and hyperlinks as an example. If I build two systems, each of them responsible for maintaining its own data elements, and a data item in System A is associated with one in System B, the approach I take is very different in the web services and REST worlds. Let’s use the systems “ContractManagement” and “Partner” as examples, with the “Contract” and “Partner” as the managed entities.

This example shows that at least for the case of resolving a reference, REST/HTTP includes a standardized “protocol” that is extremely useful in almost every scenario you can possibly think of. The same is true for many other aspects that are part of the RESTful HTTP world — updating, creating, and deleting resources, or even triggering arbitrary processing; selecting one of many available formats; handling common error scenarios. In the web services world, I need to invent a lot of this myself — I concede there are things the web services stack standardizes which have no analogy in RESTful HTTP, but I still claim that those parts that are standardized yield many more benefits.

It’s my experience that practically everybody who spends some time discussing the relative merits of web services and REST/HTTP agrees that being able to identify “things” in a consistent manner is very useful. A URI is only useful if I can do something with it, which immediately leads to a common (“uniform”) interface. Being able to do a GET on resources immediately poses the question of whether everybody wants to see a resource in the same way … continue this for a while and you’ll inevitably arrive at REST, or something very similar to it.

About

This page contains a single entry from Stefan Tilkov's Random Stuff posted on August 24, 2007 1:07 PM. The previous post in this blog was Interviewing Jim Webber. The next post in this blog is "Code First" Web Services Reconsidered. Many more can be found on the main index page or by looking through the archives.

Comments