Tuesday, June 26, 2007

PATCH for REST? Let the religious wars begin

From Stefan through to a change request memo for HTTP it looks like some people think that REST needs more than just PUT, POST, GET and DELETE. The new addition is "PATCH", which is basically a sub-section PUT on a resource.

So how will REST cope with this new interloper, a new verb being added to the mix? But surely GET, PUT, POST, DELETE are all you need to describe everything in the multi-verse? This can only go one way..

Religious war time!

I can see it now, one camp loudly proclaiming the sanctity of the 4 true verbs and holding onto the original fielding paper as proof of their validity. These people decry the "PATCHites" as heretics and bemoan their lack of understanding of the one true way. "You are doing it wrong" they will say "if you have to use patch its because your resources are to complex" and advocating that large documents should be split into many resources, thus meaning that PATCH is redundant because it can be replaced with PUT on these sub-resources. They will storm into conferences and meetings where PATCH is proposed shouting "Down with PATCH, hold true to your belief in Fielding", they will create badly drawn T-Shirts, most probably in Black with "NO to PATCH" emblazoned across them. A few will promise not to shower or shave until PATCH is defeated, but many will suspect that this is just laziness and actually what they do anyway.

Updated after comments from Stefan and Mark:
Some RESTafarians elect to retreat to distant mountain tops and observe the battle from on high, looking down on the destruction below they tut "REST is an abstract concept untainted by mere practicalities. We are unconcerned by practicality and as in theory there is no difference between theory and practice
end update to take account of REST != HTTP :)

Meanwhile on the other side the PATCHites decry the fundamentalist Fieldingites and their lack of acceptance that the world has moved on and that architectural purity is not always possible "Look" they shout "we have use cases and real world examples of why this is needed". The PATCHites will decry the lack of vision of the Fieldingites and accuse them of living in ivory towers. The PATCHites will adopt a campaign of extensive blogging and commenting and will try and fix ballots by creating multiple accounts. PATCHites will convince random business people to pretend they care and have quotes from analysts obtained after heavy drinking sessions and photoshopped pictures. PATCHites will create White T-Shirts with a picture of Darwin on it and a slogan that says "HTTP must evolve, support Patch" in letters so small as to be unreadable from over 2 feet away.

PATCHites will point to the draft specifications that were authored by Fielding and which contain a reference to PATCH saying "The original vision was always for PATCH", the Fieldingites will respond "That was put in there by evil forces trying to tempt RESTafarians away from the one true path, the only document we believe is the final published specification that has been anointed" they will claim that using unanointed specifications is a grand heresy is it implies that REST was not perfect in its conception. Using early specifications means nothing the Fieldingites will claim as they show only the tempation and challenge rather than being a definitive truth.

And there will be much gnashing of teeth and smiting on websites, newsgroups, blogs and email lists, eventually the PATCHites will be faced with a break-away faction who propose not only PATCH but that "CREATE" should be considered as the correct way to create new resources rather than a simple "PUT", these Creationists will be decryed by both the PATCHites and Fieldingites as heretics and cast into the outer darkness. PATCHites will resource to kidnapping of Fieldingites by promising them free lunches at the Googleplex and then make them work in a real company for six months as a PERL code maintainer. The war will escalate to the stage at which no debate involving any term HTTP, REST or Web will be safe and will descend into a bloody flame war.

Finally a peace will fall over the land as the PATCHites and Fieldingites realise that no-one has been listening and that people have either being getting around the lack of "PATCH" by having parametrised PUTs to automatically create sub-resources, or just didn't need it in the first place anyway because they were using only small size resources. So they will agree to put away those differences and gang up on the true heresy that is WS-*.

Technorati Tags:


Anonymous said...

Don't mistake REST for HTTP - the former doesn't care at all whether it's 4, 7, or 52 verbs, as long as the interface is uniform (i.e. supported by all resources). You might want to take a look at the Fielding dissertation again to check ...

The PATCH discussion is a pure real-world issue -- do the benefits of having another uniform verb outweigh the cost of introducing it.

Unknown said...

Please name this strawman RESTafarian who'll bawk at another method being introduced.

It appears as though your inability to understand REST is exceeded only by your inability to listen to those who do.

Unknown said...

Stefan : I have now read (in detail) the fielding dissertation (a couple of times), and now know that HTTP indeed not only isn't REST, but fails to meet many of the REST requirements. So good point I'll update the post to add in the RESTafarian purists who deny that reality is important :)

Mark: Were you talking to Stefan or me? :) Nice irony.