The Artima Developer Community
Sponsored Link

Ruby Buzz Forum
RailsConf and Rails 1.2

0 replies on 1 page.

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 0 replies on 1 page
Christopher Williams

Posts: 88
Nickname: sgtcoolguy
Registered: Apr, 2006

Christopher Williams is a Ruby, Rails and Java programmer
RailsConf and Rails 1.2 Posted: Jun 26, 2006 12:06 PM
Reply to this message Reply

This post originated from an RSS feed registered with Ruby Buzz by Christopher Williams.
Original Post: RailsConf and Rails 1.2
Feed Title: Late to the Party
Feed URL: http://cwilliams.textdriven.com/xml/rss20/feed.xml
Feed Description: Ruby. Rails. Stuff.
Latest Ruby Buzz Posts
Latest Ruby Buzz Posts by Christopher Williams
Latest Posts From Late to the Party

Advertisement

I meant to blog as the Rails Conference progressed, but the wireless network (and my own shame of my Wintel notebook) kept me from doing so. So here's my very quickly summarized notes on what I saw...

The keynotes that stuck out most for me were Paul Graham's, Nathaniel Talbott's and DHH's. The first two were not technology focused, so much as people-oriented, and DHH's was very much about the future of Rails as he sees it.

Paul Graham's Keynote

First I should mention that Paul Graham is even more entertaining in person than his essays, which is saying quite a bit.

Paul Graham's keynote focused on technology and startups, particularly on the concept that being marginal/specialized is a great quality to pursue, and leads to most innovation. The talk was essentially about the fact that the conference attendees were highly marginalized in their technology choice - Ruby and Rails - but that being at the leading edge and risking yourself was the best way to get ahead. I guess the crux of it was that too many people play it safe in too many ways, not just about technology choices, but also in careers. The talk was really an extension of his series (and Y-Combinator), prodding us alpha geeks to go out and try our hand at becoming the next big startup.

Nathaniel Talbott's Keynote

Nathaniel's speech was actually quite similar to Paul's. Their speaking styles and the analogies they drew were quite dissimilar, but their basic aim was the same: to urge us to strike out on our own and pursue our passion.

Nathaniel drew analogies between homesteading in the 1800's to creating your own business in modern times. The technology we have now allows us to create services and business with minimal overhead and a very, very small team - similar to the way the Transcontinental Railroad gave way to east coast workers to strike out, stake some land and begin a new life.

The analogy I most enjoyed, that was added from a suggestion when he gave a preparatory run through of his talk at a local user group, is the idea of "barnraising" (yes that site got up over night after his talk). The basic premise being that we have a lot of smart rails geeks here, why not help start actually implementing one another's ideas? The idea isn't particularly unique, but the concept of the Rails community helping one another out in launching their businesses really hit home for a lot of attendees. I know I've personally got about 20 small Rails projects that I started quickly and scrapped just as quickly because I didn't have time, or needed encouragement. I'm really interested to see if this has sparked any groups of attendees into hacking up some quick projects (a la Railsday).

DHH's Keynote

David's keynote focused on a couple things:

First, that Rails was successful because it often said "no" where other frameworks would say yes in terms of accepting functionality. So the calls to improve and extened various parts of Rails to help extend it into the corporate/enterprise world were alluring but if heeded too blindly or easily would lead to feature creep and bloat to the point that we'd begin to start looking like the frameworks we were leaving in the dust.

Second, he talked about the immediate future for Rails, Rails 1.2. Rails is embracing REST. Really, really embracing REST. This means new routes like so:

map.resource '/person'

Which would give RESTful URLs, which would automagically map to the conventional controller method names.

Let's look at a controller in this scheme, with the URL mapped to the method it would invoke:

class PeopleController < ApplicationController
  def index # GET /people
  end

  def create  # POST /people
  end

  def edit # GET /people/1;edit
  end

  def new # GET /people;new
  end

  def show  # GET /people/1
  end

  def destroy  # DELETE /people/1
  end

  def update  # PUT /people/1
  end
end

We're moving beyond GET and POST in Rails 1.2 - it'll be done by doing some hacking in terms of setting an HTTP header with the HTTP method we want to actually invoke (since HTML doesn't actually support PUT and DELETE).

Neat stuff, wqe're trying to move more towards convetniosn in our controller and views - and embracing the single URL approach of an URL as a resource and handling representation in different ways. There's also a new mime type idea, where we start using the URL's extension as the clue as to which format we'd want back. (We pushed to drop extensions long ago because .jsp, .php, or .asp didn't mean anything to the user - they were leaking the implementation language. DHH wants to re-introduce extensions as a means of letting the server know what format we want the representation in). Let's look at an example:

class PeopleController < ApplicationController

  def show
    @person = Person.find(params[:id])
    respond_to do |wants|
      wants.html # renders 'show.rhtml' template
      wants.js # renders 'show.rjs' 
      wants.xml { render :xml => @person.to_xml }
    end
  end

end

Now we can add extensions to recognize using their mime-type and use that to determine what to return to the user.

Building on all of this, David wants to create a new way of convention over configuration in web services: Enter ActiveResource. When we have REST APIs, everything gets pretty simple, we can start doing things across web services almost like ActiveRecord.

Person = ActiveResource::Struct.new do |p| 
  p.uri "http://www.example.com/people"   
  p.credentials :name => "dhh", :password => "secret" 
end

#Issues GET http://www.example.com/people/1
matz = Person.find(1) 
matz.name # => "Matz"

No more SOAP, no XML-RPC, no nothing. Just grab the XML representation and translate it back into a Ruby object.

The talk certainly worried a number of people, but the promise of this is incredible. We're getting nice simple web services, and we're getting URIs that really represent resources, and it's becoming very easy to do multiple representations quickly. Really exciting stuff here.

Read: RailsConf and Rails 1.2

Topic: Ruby 1.8.5p1 Released Previous Topic   Next Topic Topic: CNSL 2: Mesa de Trabajo de Desarrollo Web

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use