Monday, 20 March 2006
Don’s False Choice
True to form, Don’s using his witty charm and good looks (such as they are ;) to shape discussion of a topic… in this case, REST, where he splits the RESTifarian world into two; “hi” and “lo.”
To get a more accurate picture of what we’ve done so far, I’ll break this category in two: Lo-Rest, which is the use of HTTP GET (or equiv) for information retrieval/query, and Hi-Rest, which is characterized by the use of HTTP PUT and DELETE (or equiv) for doing update.
This is a false choice, because REST is not about GET, PUT, POST and DELETE as such. It’s about using uniform verbs to gain transparency, using hypermedia as the engine of application state, and leveraging the deployed standards and infrastructure. The HTTP methods are just the uniform verbs in one RESTful protocol.
Still, it’s understandable, because there’s been a lot more heat than light about REST, and some of the cargo culters have decided “POST bad, PUT good.” In truth, it’s not at all black and white. REST is not a set of unbreakable rules, it just gives you properties that you can choose to use — or elect not to — based on your application’s needs. It requires the designer to be intelligent (in the good science way), not a set of magic tools or unbreakable rules.
Don has effectively made the observation that a lot of other people (especially of the Web services sort) have made; while the benefits of GET’s transparency are obvious, they’re less apparent for PUT and DELETE, so why not just take the easy (lo) road and use POST?
I think there are two answers; 1) hopefully, we’ll have some concrete benefits for that transparency some day (think offline), and 2) thinking in terms of GET/PUT/DELETE first — using POST only as an escape hatch — leads you down a path where your application will be using transparent methods a lot more than opaque POSTs.
In the meantime, I don’t see much benefit to dividing the REST world into “hi” and “lo.”