Every so often, you come across a book that not only informs, but challenges your perceptions, leaving you seeing things in a way that you would not have before you started reading. I have a fair number of science fiction books that I’ve read over the years that left me in the major paradigm shift state after reading it (usually at about three in the morning), but its been rare in recent years that I’ve found a tech book that has done so. However, the book RESTful Web Services by Leonard Richardson and Sam Ruby (O’Reilly press, 2007) managed to do just that.
Pretty much since the inception of SOAP back in the late 1990s, I’ve felt that somewhere along the line something went horribly wrong in web programming … it lost the “web” part. The idea behind SOAP, of using a predefined envelope for sending messages, makes a certain sense, but it was about the time that WSDLs began to appear, with it’s ports and connections and services that the fundamentally simple paradigm of the web suddenly became this effort to try to turn web services into COM-like boxes, each of which had their own complex interface, and all of a sudden you couldn’t get Microsoft web services talking with their Java counterparts or integrating cleanly with PHP web services.
You can make the argument that the goal behind all of this was to make web programming so complex that it could only be handled by generators sitting in the background, generators that of course could only be tied into their respective proprietary platforms. Of course that’s so much silliness - no vendor would ever deliberately complexify the web just in order to lock in their customers, after all - so after a while I was beginning to think that after some twenty five years working with programming that maybe I was just a little too stupid to comprehend this new WS-* web … and so I went back to good old basic HTTP.
Curiously enough, though, somewhere along the line the AJAX movement came along, and Ruby, and Atom and XQuery services and the whole RESTful web sort of thing, and I began to realize that maybe, just maybe, the WS-* technology stack was so complicated because they just didn’t understand the way that the web really worked. And that was a rather disturbing thought.
You see, when the smoke finally clears at the end of the day, the web isn’t the big replacement to COM and CORBA and RMI and the whole alphabet of interchange formats. It’s simply a way to publish things. We PUT resources on the web, we GET resources from the web. Occasionally, we need to POST content, but the primary role of POSTing is not to provide an alternate way to pass larger blocks of content to the server … it is in fact just a way of appending content to a given location on the web. We need to DELETE objects occasionally, and we need to get enough information via HEAD to understand what a given service can do and OPTIONS to determine what that service can expose. The web interface is simple - you put things, get things, delete things. You don’t need a huge API that is exclusive to your server and that only works well with Microsoft clients to perform these basic things, and if you can subclass these operations you don’t necessarily even need them for more advanced ones.
This was the message of Richardson and Ruby. From the preface,
We wrote this book to tell you about an amazing new technology. It’s here, it’s hot, and it promises to radically change the way we wrte distributed systems. We’re talking about the World Wide Web.
Okay, it’s not a new technology. It’s not as hot as it used to be, and from a technical standpoint it’s not incredibly amazing. But everything else is true. In 10 years the Web has changed the way we live, but it’s got more change left to give. The Web is simple, ubiquitous, yet overlooked platform for distributed programming. The goal of this book is to pull out that change and send it off into the world.
It may seem strange to claim that the Web’s potential for distributed programming has been overlooked. After all, this book competes for shelf space with any number of other books about web services. The problem is, most of today’s “web services” have nothing to do with the Web. In opposition to the Web’s simplicity, they espouse a heavyweight architecture for distributed object access, similar to COM or CORBA. Today’s “web service” architectures reinvent or ignore every feature that makes the Web successful (italics mine).
Wow! If this isn’t a shot across the bow of the WS-* stack, I don’t know what would be. Richardson is well known in the Ruby community as one of the key RAILs evangelists, while Sam Ruby is an icon in the XML and web technologies spaces who has written extensively about REST and is, among many other things, one of the principal designers of the Atom news feed standard and the Atom Publishing Protocol (AtomPub). They are two of the most respected authorities in the field, and their mission here, quite simply, is to wake people up to the fact that the core web protocols, in place since the early 1990s, is still more than the match of any number of “proprietary frameworks” that purport to simplify web development and only serve to put an expensive, entrapping barrier between the simple web and the application developer.
If you are involved in web development in any capacity, get this book, commit it to memory, then read and reread it. Like many other books that are part instruction and part inspiration, you will find yourself dipping into this book at various points and extracting out gems and insights from every page, and in the end you’ll find that maybe, just maybe, the world really doesn’t need to be any more complex than it already is.
Kurt Cagle is an author, information architect and web consultant specializing in XML based technologies. He blogs regularly at MetaphoricalWeb.org and runs the XML News Network portal. He lives in Victoria, British Columbia, but is still rooting for the Mariners to get to the playoffs!