InfoQ

Presentation

Recorded at:
Recorded at

Designing RESTful Rails Applications

Posted by Obie Fernandez on Jul 31, 2008 09:42 PM

Community
Ruby,
SOA
Topics
Technology,
REST,
Ruby on Rails
Tags
QCon San Francisco 2007,
QCon
Summary
In this presentation from QCon SF 2007, Obie Fernandez explains REST and gives practical tips on how to use Rails' REST features to write RESTful applications.

Bio
Obie Fernandez is the CTO/Founder of HashRocket, a boutique web consultancy and product shop headquartered in Jacksonville Beach, Florida. He has a blog http://obiefernandez.com/ and speaks at conferences and technical user groups on a regular basis. He is a series editor and book author for Addison-Wesley.

About the conference
QCon is a conference that is organized by the community, for the community.The result is a high quality conference experience where a tremendous amount of attention and investment has gone into having the best content on the most important topics presented by the leaders in our community.QCon is designed with the technical depth and enterprise focus of interest to technical team leads, architects, and project managers.

5 comments

Reply

Problems .... by Jimmy Coyne Posted Aug 1, 2008 9:39 AM
Re: Problems .... by Jimmy Coyne Posted Aug 1, 2008 10:26 AM
Re: Problems .... by Jean-Jacques Dubray Posted Aug 1, 2008 3:05 PM
Re: Problems .... by Fazil Obali Posted Sep 15, 2008 5:34 AM
Slides by Mark Richman Posted Aug 5, 2008 12:34 PM
  1. Back to top

    Problems ....

    Aug 1, 2008 9:39 AM by Jimmy Coyne

    I'm having trouble getting this video to play.It has also managed to crash firefox3 and IE 6.

  2. Back to top

    Re: Problems ....

    Aug 1, 2008 10:26 AM by Jimmy Coyne

    Interesting ... with the same laptop, it works when outside the corporate network.

  3. Back to top

    Re: Problems ....

    Aug 1, 2008 3:05 PM by Jean-Jacques Dubray

    Obie:

    thanks for this interesting talk. There is definitely a lot of thinking behind it. If I understand the core of your argument, you are able to replace a typical action invoked from the controller by a combination of HTTP verb and a noun.

    So instead of login/logout you create/delete a session resource, instead of reserving something you create a reservation resource, and so on...

    The question I have is what do you gain in doing that. Unfortunately you mentioned in the talk that it was not part of your scope to talk about the implementation. If I try to imagine a new bid resource posted to an auction/bids I am wondering how different your implementation look like? aren't you mapping back from the resource representation to an action (say a stored procedure)?

    Resources are "navigational" in nature, they are not "relational", in other words when a resource (representation) embeds a link to another resource, there is absolutely no way to "navigate" back from the target resource to the source resource, unless you also add a link there. This means in particular that if you truly transform an action into a physical resource creation, you would have to "search" these resources to understand the state in which the parent resource is (remember that when you are posting a session, you are not doing a PUT to the user to change its state to "logged in"). So to figure out if you, as a user are logged in, you would have to search the "sessions" for one that matches your profile. To know if something is reserved, you'll have to search the reservations and figure out if one matches to thing being reserved, and so on...

    If on the other hand you are converting RESTful actions (HTTP verbs + nouns) into a store procedure call or a SQL statement, what have you gained?

    I don't buy the "cacheability" argument because I don't know many enterprises that would "cache" the content of a bank account or an insurance policy. I don't buy the HATEOS benefit either, because as you very well know in MVC there is the annoying path where the model needs to update the view because something has changed in the back-end. Again in the enterprise things happen in the back-end. As a matter of fact, I was a bit surprised that in your talk you did not really mentioned HATEOS and that the "actions" seemed to be a bit "external" to the resource representations, which IMHO would be an anti-pattern for REST.

    thanks,

    JJ-

  4. Back to top

    Slides

    Aug 5, 2008 12:34 PM by Mark Richman

    Could you please make the slide deck available for download?

  5. Back to top

    Re: Problems ....

    Sep 15, 2008 5:34 AM by Fazil Obali

    İntresting.Laptop crash firefox3. Thanks. İntresting technology.I like this technology. Thanks. Oto Kiralama

Exclusive Content

Measuring Agile in the Enterprise: 5 Success Factors for Large-Scale Agile Adoption

Michael Mah analyzes the development process in 5 companies: 2 Agile (one of them BMC) and 3 classic. He presents the factors which contributed to the success of BMC's Agile adoption.

Tom Preston-Werner on Powerset, GitHub, Ruby and Erlang

In this interview filmed at RubyFringe 2008, Tom Preston-Werner talks about how both Powerset and GitHub use Ruby and Erlang, as well as tools like Fuzed, god, and more.

David Laribee on Alt.NET and its Mission

David Laribee discusses the purpose of ALT.NET, its mission and future.

Discover RailsKits and Stop Writing Redundant Code

Ruby on Rails has become a popular Ruby framework for creating web applications in recent years. An aspect of creating a web application is the need to repeatedly create the same base functionality.

A Formal Performance Tuning Methodology: Wait-Based Tuning

Steven Haines talks about tackling web application performance tuning by proposing a method called wait-based tuning.

Shaw and Fowler About Forging a New Alliance

Shaw and Fowler talk about the need for a new relationship between the business department and the IT department. Studies have shown that projects mostly fail due to miscommunication between the two.

How to GET a Cup of Coffee

In this article, Jim Webber, Savas Parastatidis and Ian Robinson show how to drive an application's flow through the use of hypermedia in a RESTful application.

Archaeopteryx: A Ruby MIDI Generator

Eccentric artist turned overnight anti-celebrity, Giles Bowkett captures the heart and soul of RubyFringe as he demonstrates his revolutionary Archaeopteryx MIDI drum pattern generator.