An open question with the World of Resources paradigm is how to do searches.
GET /people returns all people,
GET /people/23 gets one person... but how do you get something in between? What we need is the equivalent of
:conditions on an ActiveRecord find.
One approach is to use a GET request with conditions on the URL. So to find all males older than 25 years of age:
DHH said this is a good way to go, but I wonder. One, this approach will eventually run into the URL length limit. But more importantly, it's not using the CRUD approach of reifying abstractions.
Instead, consider using a Search model. Create a search resource that holds all the options for the query. Then you can execute it whenever you want.
POST /searches (post data contains query options) would redirect to
GET /searches/42 or
GET /people/?searches=42. You could even make it so that searches are unbound until execution, like blocks:
I need to try this out and see how it works, but I won't have a chance to do that for a few days.