1,293 karma · joined August 14, 2007
You're not listening, and you're not arguing in good faith.
The crucial thing that you're missing is that it's being told how to construct that URI in-band. Not in a piece of documentation that has to be hard-coded into the client.
You're talking about wire formats and structures that feel natural to use for particular kinds of calculations. I'm talking about recognizing properties that we might need a particular system to have (ease of use being only one of them), and ensuring them.
The line I quoted tells us exactly which problems (in the sense that I'm talking about) REST is suited for: the ones where those benefits are needed (and where the tradeoffs aren't to costly).
The distance between the two cities.
> You have to come up with some added, unnecessary, implementation-exposing abstraction like "CityPair".
This is a really weird thing to say. No, you don't. I have no idea why you would think that.
> What are the four CRUD operations for it? [...] In which case "delete" could be ill-defined
Not every method has to be valid for every resource. It's a total non-issue that you can't delete a distance.
(And POST/GET/PUT/DELETE is a very different concept from CRUD.)
This merely happens to overlap significantly with the requirements of public APIs.
I have difficulty imagining your distance calculator needing any of those things, though.
> 2. instruct clients on how to construct appropriate URIs
> 3. link a URI for the starting city and then from there link them to possible choices of the second city
All three of these are possible RESTful solutions, and I can imagine situations where each of them might make sense.
But what you're probably looking for is something like this:
<form><select name="city1">...</select><select name="city2">...</select></form>
(Using URL templates is a potentially simpler way to achieve the same thing). This is, of course, your solution 2.There are tradeoffs involved in using this style. Are they worth it? That really depends on the larger system and all kinds of details which you've left out.
"REST provides a set of architectural constraints that, when applied as a whole, emphasizes scalability of component interactions, generality of interfaces, independent deployment of components, and intermediary components to reduce interaction latency, enforce security, and encapsulate legacy systems."
The existence of these properties should be fairly evident when you examine the constraints.
I think large part of the confusion comes from not recognizing the difference between "Any system can be built in a RESTful style" (this is true) and "Every system should be built in a RESTful style" (this is a straw man).
You can make calling a function on a remote machine look and seem (superficially) like calling a local function, but they will never have similar behaviour. A network is very different from a motherboard.
http://www.tbray.org/ongoing/When/200x/2009/05/25/HTTP-and-t...
Oh, please. It's exactly this kind of self-congratulatory bullshit that produces this community's inch-deep intellectual culture.
(Because: http://en.wikipedia.org/wiki/Cane_toads_in_Australia . These are complex, poorly understood systems, and the results will almost certainly not be what you expected. This isn't engineering.)
/tmp $ mkdir -p a/b/c
/tmp $ mkdir -p a/d/e
/tmp $ cd a/b/c
/tmp/a/b/c $ ln -s /tmp/a/d .
/tmp/a/b/c $ cd ../../
/tmp/a $ ls */*
b/c:
d
d/e:
/tmp/a $ rm -rf b
/tmp/a $ ls
d
It would be pretty stupid for it to.We don't need to inject discrimination and close-mindedness, but we do need to counteract it. That means we can't just passively "be open".
You're wrong. There are lots of things that women experience that men do not (and vice-versa).
The word "only" makes this sentence completely wrong.
In startup terms it's like saying that to make a successful product you need only make something useful and put up a web page offering it for sale. It would be great if it was that simple!
That doesn't follow at all. It could be that the industry has some kind of blind spot that could be easily addressed by e.g. encouraging and welcoming people who are interested but generally left out.