|
|
|
|
|
by bct
4954 days ago
|
|
> what resource is it acting on? 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.) |
|
>The distance between the two cities.
Don't be cute. What server resource is it acting on? The value of the distances is (potentially) computed by some encapsulated algorithm -- you're not acting on that resource. The server resources that are touched are the two cities, and then whatever it does behind the scenes.
>This is a really weird thing to say. No, you don't. I have no idea why you would think that.
Because I'm not GETing a city, so I can't use the GET operation on the city resource; I have to make another resource to GET. Fine, it doesn't have to be a city pair: but there is a many-to-many mapping, which in REST-favoring frameworks (e.g. Rails), requires a separate table. By reducing everything to CRUD, you must create a new resource (type) for each new operation.
>(And POST/GET/PUT/DELETE is a very different concept from CRUD.)
That's a non-standard definition of "very different", considering that POST is create, GET is retrieve, PUT is update, and DELETE is delete.