On Fri, Aug 6, 2010 at 8:53 PM, BrianTheLion <[email protected]> wrote:
> It seems like building a REST application is The Right Thing To Do. I
> tend to want to create a controller for each entity in my object
> model, and the rationale behind the REST paradigm gives this idea some
> support.

Keep in mind that REST's biggest advantage is with non-browsers: news
aggregators, WEBDAV, noninteractive programs. Things that don't want
to know about your site's quirks, but only know enough to update  a
resource with PUT and delete it with DELETE.  It's especially useful
with dumb objects that don't have a lot of custom ways to interact
with them. For instance, it works great for Amazon S3 because the site
considers it a generic file, so there's nothing to do with it except
list it, replace it, and delete it.

REST can also be useful in an interactive website to keep things
organized, but it's less necessary there. Some objects don't have a
full add/modify/delete interface, for instance. Some actions have side
effects beyond their typical REST interpretation. For example,
deleting your account is a drastic step, so it makes sense to have
that as a special URL rather than just doing a mundane DELETE on the
user URL.

> of http://pylonsfacebook.com/photo/981388324/icon and

I think I mentioned before that the collection name has to be plural
if you're doing the whole ATOM interface with add/modify/delete. So
this is a good URL, and it's RESTful according to the rule "Every URL
component logically contains the one on its right." But you can't do
all the resource operations. For instance, "/photo" to list the
photos? That looks odd. But then again, if you're not allowing users
to list the photos anyway, it doesn't matter.

-- 
Mike Orr <[email protected]>

-- 
You received this message because you are subscribed to the Google Groups 
"pylons-discuss" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/pylons-discuss?hl=en.

Reply via email to