> So, which method is more ReSTful? To me the first one is ReSTful, the
> second one isn't, but Mike obviously has been thinking about ReST
> longer
> than I have... so I accept that I'm probably missing something.
Maybe I am missing something, but since several people have said that
REST implies opaqueness in the URI, my guess is that a legend
has somehow begun and I need to put it to rest (no pun intended).
REST does not require that a URI be opaque. The only place where
the word opaque occurs in my dissertation is where I complain about the
opaqueness of cookies. In fact, RESTful applications are, at all times,
encouraged to use human-meaningful, hierarchical identifiers in order
to maximize the serendipitous use of the information beyond what is
anticipated by the original application.
It is still necessary for the server to construct the URIs and for the
client to initially discover those URIs via hypertext responses, either
in the normal course of creating the resource or by some form of query
that results in a hypertext list. However, once that list is provided,
people can and do anticipate the names of other/future resources in
that name space, just as I would often directly type URIs into the
location bar rather than go through some poorly designed interactive
multi-page interface for stock charts.
Sites that rely on interstitial advertising (like the annoying yahoo
groups interface) do not like it when user's avoid the indirect path,
but the social network-effect of the Web is enhanced by meaningful URI.
In general, sites that give meaningful URI are used more often.
It also helps prevent the "lost in hyperspace" syndrome, but that's
a separate issue.
Cheers,
Roy T. Fielding, co-founder, The Apache Software Foundation
(fielding@...) <http://www.apache.org/>
Chief Scientist, Day Software
2 Corporate Plaza, Suite 150
Newport Beach, CA 92660-7929 fax:+1.949.644.5064
(roy.fielding@...) <http://www.day.com/>