Get flash to fully experience Pearltrees
A few weeks ago, I sent the following in a email to a co-worker asking for input on designing REST APIs in Django. Since then, I’ve quoted myself a few times; I thought these thoughts would be worth a (slightly edited) public home. I think the best way to dive in terms of mistakes to avoid.
There's a mini-controversy going on over the importance of hyperlinks, and whether they're only usable by humans. Jonathan Marsh seems to think that hyperlinks are less useful for machine-to-machine interaction. The REST viewpoint seems to be that services without hyperlinks "dead-end" the Web, hence the absence of solid support for links in SOAP is a further argument against its usefulness.
There has been a long running debate in the Application Platform Services Group here at Burton Group between the REST people on one side and the SOAP people on the other. For the most part it mirrors the external debate. In one recent exchange, while discussing the complexity of SOAP and the web services framework, the SOAP side said, “Before all of the WS-* stuff, SOAP was actually simple. That’s what the ‘S’ stood for.” And now a history lesson.
A model (developed by Leonard Richardson) that breaks down the principal elements of a REST approach into three steps. These introduce resources, http verbs, and hypermedia controls. Recently I've been reading drafts of Rest In Practice : a book that a couple of my colleagues have been working on. Their aim is to explain how to use Restful web services to handle many of the integration problems that enterprises face. At the heart of the book is the notion that the web is an existence proof of a massively scalable distributed system that works really well, and we can take ideas from that to build integrated systems more easily.
Every time some Web application service provider comes up with a Web services API that allows developers to integrate with their services, a lot of attention is paid to the interaction design pattern implemented by the API. If the API uses the REST-style interaction, proponents of the REST approach laud the API as a grand example of why REST-style services are far superior to SOAP-style services; likewise if the API uses a SOAP style Web service pattern. Little attention seems to be paid to the fact that the choice of pattern depends largely on the type of application being implemented and, like all good architectural decisions, developers should base their choice on the specific technical needs and characteristics of the application being developed rather than on some particular affinity towards a single architectural approach.
In my recent 2008 predictions for the future of Web services and open APIs for enterprise applications, I said that we'd finally see a large scale movement to newer, lightweight Web-based models for opening up our software systems and integrating them together. In other words, heavyweight SOA has finally fallen out of favor and lightweight SOA -- sometimes known as Web-Oriented Architcture (WOA) , is in. However, this sea change has long since taken place on the Web and this year will see best practices in this area take another major step forward as we'll examine below. The recent convergence of the Web, SaaS, SOA , and other approaches has also made the boundaries between our architectures and systems increasingly intertwine and blur.