Link Details

Link 42038 thumbnail
User 246202 avatar

By peimei
via railsjitsu.com
Published: Sep 16 2007 / 19:13

The thing I hear the most when other developers ask me questions about RESTful routing is that it limits controllers to the 7 basic operations, index, show, new, create, edit, update, and destroy, and that in turn limits both the developer and the application. Well, yes and no, is my usual response. You see, it DOES limit your controllers to those 7 actions, yet it does not limit the developer or the application. However the said developer and application does need to undergo a paradigm shift in order to not be restrained in a negative sense.
  • 12
  • 3
  • 1321
  • 504

Comments

Add your comment
User 200691 avatar

lem z replied ago:

0 votes Vote down Vote up Reply

I would really like to read an article explaining why RESTful Rails is better than non rest. Every article I keep reading explains how rest is different but none say why it's better (i assume it is). I'm pretty happy with routes so far and don't see the overwhelming appeal of going REST. What are they?

> So what do we get by limiting ourselves to RESTful thinking and design?
> For one, the ability to code ONE application that can service many different
> types of viewer including both machine and human, and different types of
> requests, like traditional HTTP, AJAX, or XML (and RSS).

Could you expand on this a bit more?

User 224073 avatar

michaelklishin.myopenid.com replied ago:

0 votes Vote down Vote up Reply

LemZ,

> I would really like to read an article explaining why RESTful Rails is better than non rest

Apps are way more discoverable, resources force you to think about your domain a bit harder and you get application and models organizations that is easy to understand from 1st look.

User 200691 avatar

lem z replied ago:

0 votes Vote down Vote up Reply

Discoverable in what sense?

User 247073 avatar

richrds replied ago:

-1 votes Vote down Vote up Reply

Please do not post every single one of your own blog's entries, the one was more than enough.

User 224073 avatar

michaelklishin.myopenid.com replied ago:

0 votes Vote down Vote up Reply

I think this one should be called Resouceful thinking cause it's about resources, not REST itself, that makes Rails applications even more discoverable and organized.

User 246202 avatar

peimei replied ago:

0 votes Vote down Vote up Reply

I don't post every one thank you very much, but I can post the ones I want, show me where I cannot. I think the point of a community is to provide resources.

By designing your app in a restful manner you aren't just more discoverable, you are more acessable. It also help a lot in managing not just your controllers in a unified manner, but the url heplers that come with it are a great time saver and keep you from having broken links. You can of course do this with named routes as well, but then you have to create one for every action in every controller and it quickly becomes unmanageable.

Hope that helps.

User 246202 avatar

peimei replied ago:

0 votes Vote down Vote up Reply

Another thing richards, I see you have only voted down 3 resources and commented on one. Please do not tell those of us who are active in the dzone sphere how to play in our own playground. The more resources, comments, and votes, the more vibrant the community.

Add your comment


Html tags not supported. Reply is editable for 5 minutes. Use [code lang="java|ruby|sql|css|xml"][/code] to post code snippets.