Sylvain Hellegouarch wrote:
Indeed, IMO the three are equivalent (in fact 2 and 3 are the same). If we refer
to REST we have:

http://www.ics.uci.edu/~fielding/pubs/dissertation/evaluation.htm#sec_6_2_4

Which clearly indicates that the underlying implementation should be seen
through the URI to access a resource. So in the end if we could support the
three different URLs to access a resource it would be the best.

*That's* certainly not what I would propose. I'd rather take the crappiest of the options (um... let's say /edit?class=myapp.Articles?id=10) than multiple ways to access the resource with the same meaning.

Reading that particular document, my impression is that he is saying that URIs don't matter, that they are opaque strings, and their only meaning is what you can do with them. They don't represent "resources", only "potential actions", and if you read anything more into the strings you are overstepping the abstractions of the web.

Some REST principles seem unattainable in this context as well, like the fact we are strictly limited to the GET and POST verbs. This is why I think ?action=edit is reasonable, as it is the verb and there's no real positional location that implies verb. It's an inversion of the typical URI of edit?id=10, where the path is the verb and the variables are the noun.

Of course, a real set of actions would be more like:

view: show a representation
editform: show a form to edit the item
save: save changes to an item
delete: delete an item
createform: show a form to create an item
create: actually create the given item
select: show several items (e.g., /articles/ typically means select all).

Several of these should *absolutely not* be in the URI, specifically "delete", "save", and "create". Now, you could conflate these with other actions, e.g., editform and save (edit+GET=editform, edit+POST=save), and createform and create, and some arbitrary action and delete (maybe select or even view). But I don't think that's very REST, if we're throwing about terms.

But on the other hand, this is a total Bike Shed moment, so whatev'.

--
Ian Bicking  /  [EMAIL PROTECTED]  /  http://blog.ianbicking.org

Reply via email to