# Who uses RESTful?

**URL:** <https://www.ruby-forum.com/t/who-uses-restful/144911>\
**Category:** Rails\
**Created:** [August 4, 2008, 10:11am UTC](https://www.ruby-forum.com/t/who-uses-restful/144911 "2008-08-04T10:11:26Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![paulbutcher](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/a5b964/32.png) [@paulbutcher](https://www.ruby-forum.com/u/paulbutcher)\
**Post date:** [August 4, 2008, 10:11am UTC](https://www.ruby-forum.com/t/who-uses-restful/144911/1 "2008-08-04T10:11:26Z")

</div>

I’m not into RESTful yet, as I haven’t understood it completely. So my  
question might fall back on that. I’m trying to learn it but I can’t see  
it will be useful for me.

Who uses RESTful? I mean often an app is not that straightforward. A  
simple RESTful setup is more like an interface to the db, not a real  
world scenario. And often you will use plain html and not other format  
outputs, such as xml. A real app will have many different custom actions  
and solutions that breaks the RESTful setup, right? What’s your view on  
RESTful?

---

<div class="post-metadata">

**Author:** ![paulbutcher](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/a5b964/32.png) [@paulbutcher](https://www.ruby-forum.com/u/paulbutcher)\
**Post date:** [August 4, 2008, 11:09am UTC](https://www.ruby-forum.com/t/who-uses-restful/144911/2 "2008-08-04T11:09:12Z")

</div>

Kiran Soumya wrote:

> Clean URLs. REST URLs represent resources and not actions.

Yes that’s good. But does it really matter? And my point is that it  
might often be broken when you have all your custom solutions. At least  
that’s the case for me. Many web apps is not that simple that a RESTful  
interface will do it. RESTful is more a UI for interacting with the db.  
Correct me if I’m wrong.

> Different Response Formats. REST controllers are developed in a way  
> that actions  
> can easily deliver their results in different response formats.  
> Depending on the requirements  
> of the client, the same action can deliver HTML, XML, RSS, or other

And how often do you use that? And if you do use it it will be for a  
specific set of data which is really simple to implement for that simple  
purpose.

> Less Code. The development of multi-client-capable actions avoids  
> repetitions in  
> the sense of DRY2 and results in controllers having less code.

That’s a plus.

---

<div class="post-metadata">

**Author:** ![paulbutcher](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/a5b964/32.png) [@paulbutcher](https://www.ruby-forum.com/u/paulbutcher)\
**Post date:** [August 4, 2008, 10:44am UTC](https://www.ruby-forum.com/t/who-uses-restful/144911/3 "2008-08-04T10:44:07Z")

</div>

If we want to make a distinction between REST- and non-REST-based  
Rails applications, we use the  
word traditional. Traditional does not mean old or even bad, it’s only  
used to make a reference to an  
equivalent non-REST concept. This comparison should help to better  
explain the new technology.

Feature list of REST-based Applications makes clear:

Clean URLs. REST URLs represent resources and not actions. URLs always  
have the  
same format: first comes the controller and then the id of the  
referenced resource.  
The requested manipulation is independent of the URL and is expressed  
with the  
help of HTTP verbs.

Different Response Formats. REST controllers are developed in a way  
that actions  
can easily deliver their results in different response formats.  
Depending on the requirements  
of the client, the same action can deliver HTML, XML, RSS, or other  
data  
formats–the application becomes able to handle multiple client  
demands, cleanly  
and simply.

Less Code. The development of multi-client-capable actions avoids  
repetitions in  
the sense of DRY2 and results in controllers having less code.

CRUD-oriented Controllers. Controllers and resources melt together  
into one unit–  
each controller is responsible for the manipulation of one resource  
type.

Clear Application Design. RESTful development results in a  
conceptually clear and  
maintainable application design.

Reference document:  
[http://media.quilime.com/files/pdf/restful\_rails\_en.pdf](http://media.quilime.com/files/pdf/restful_rails_en.pdf)

Regards,  
Kiran.

On Aug 4, 1:11 pm, Pål Bergström [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)

---

<div class="post-metadata">

**Author:** ![paulbutcher](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/a5b964/32.png) [@paulbutcher](https://www.ruby-forum.com/u/paulbutcher)\
**Post date:** [August 4, 2008, 1:07pm UTC](https://www.ruby-forum.com/t/who-uses-restful/144911/4 "2008-08-04T13:07:39Z")

</div>

Hi –

On Mon, 4 Aug 2008, kiranH wrote:

> > and solutions that breaks the RESTful setup, right? What’s your view on  
> > RESTful?
> 
> Different Response Formats. REST controllers are developed in a way  
> that actions can easily deliver their results in different response  
> formats. Depending on the requirements of the client, the same  
> action can deliver HTML, XML, RSS, or other data formatsâ€“the  
> application becomes able to handle multiple client demands, cleanly  
> and simply.

That’s not specific to resource-routed controllers, though. You can  
use respond\_to and so forth with traditional routing.

> CRUD-oriented Controllers. Controllers and resources melt together  
> into one unitâ€“ each controller is responsible for the  
> manipulation of one resource type.

They can melt together, but it depends a bit on what your resource is  
and how it maps to its persistence mechanism (if it has one). Here’s  
some elaboration of some of this:

[http://dablog.rubypal.com/2008/3/23/splitting-hairs-over-resource](http://dablog.rubypal.com/2008/3/23/splitting-hairs-over-resource)  
[http://dablog.rubypal.com/2008/4/24/splitting-hairs-over-resource-part-2](http://dablog.rubypal.com/2008/4/24/splitting-hairs-over-resource-part-2)

David

–  
Rails training from David A. Black and Ruby Power and Light:

- Advancing With Rails August 18-21 Edison, NJ
- Co-taught by D.A. Black and Erik Kastner  
See [http://www.rubypal.com](http://www.rubypal.com) for details and updates!
