03/23/09 :: [REST] To Crud or not To Crud... That is the QUESTIon ... [permalink]

Tell me if you CRUD and I'll tell you who you are...It looks like after all that Roy does not like CRUD. He is gently but surely asking the RESTafarians to CRUD no more. You must admit that how low can a RESTafarian go? My eyes fell off my head when I read this comment from Mike Kelly on Roy's post:

... I’m still struggling to understand why ‘monitored’ state should be preferred as non-editable.

I'd be curious to know what Roy thinks of all this CRUD. I can guarantee you that more than 95% of the people using "REST" will CRUD.

Stefan continues:

I often find that I chose PUT instead of POST (and end up creating an additional resource in the process) because the behavior requires idempotence. That seems preferable IMO to making POST idempotent.

Stefan was laughing at my proposal to declare the idempotency at the message level and not at the verb level so he decides when to use a VERB simply on the idempotency property. Don't you find that odd? Wouldn't be a lot more natural to reserve a verb for "updates" and a verb for "actions"? Some actions being idempotent? Surprisingly, even Roy seems to be a bit confused on the question:

Stefan, I think it is better to say that we only use PUT when the update action is idempotent and the representation is complete.

Stefan, come on... how can someone like you recommend CRUDing? Don't you see the coupling?... How could Roy agree with that? The reason why I say Roy is confused is because of the combination "idempotent action" and "representation is complete". Probably the only action that generally matches these requirements is a "Replace" of the content of the resource (which should always be forbidden unless you are dealing with very simple lifecycles like the one of a Web page). A typical action will simply convey the resource action identifier and the arguments that are necessary to perform the action. Associating actions with a Single Verb (POST) is the way to go.

I guess Roy's precisions clarify the little discussion I had with Anne.

TThe RESTafarians have entered the second phase of their battle. Now they have made enough noise to have REST being tried out by lots of vendors and some vendors actually providing an implementation, "anything" HTTP can do is RESTful. REST does not have "actions"? no problem Tim Bray adds a controller and some actions or  Stefan and Anne suggest CRUDing. I am really impressed at your integrity guys.

As a result, Roy is in this uncomfortable position to always remind people what is RESTful or not, yet he wants REST to expand. Sadly no one even draws a simple state machine to reason about the problem.

REST is the equivalent to the Real Estate bubble, vendors and developers adopt it under the wonderful premise of ultimate simplicity, the RESTafarians jubilate, when the developers will finally understand the trap in which they fell, it will be too late. Many Apps will simply fall under the weight of their CRUD.

The (other) REST is just a fallacy,, deeply and totally fallacious guys.