Upgrade to Pro — share decks privately, control downloads, hide ads and more …

RailsConf 2009 - Rails 3: Stepping off of the g...

RailsConf 2009 - Rails 3: Stepping off of the golden path

Back in December 2008, the Rails and Merb core teams surprised everybody by deciding to merge their teams and focus their energy on a common release: Rails 3.0. On one hand, Rails is famous for being an opinionated Rapid Application Development framework following the well known “convention over configuration” design paradigm. On the other hand, Merb is known for its performance, extreme modularity and greenfield experimentations. The new unified team is working on having the best of both worlds, but the real questions are:

How does that affect me as a Ruby/Rails/Merb developer? When should I step off of the golden path and why?

Matt Aimonetti, Merb core and Rails team member will take you through the new world of possibilities now available to Rails 3.0 developers. You will see the pros and cons of different options for people desiring to step off the “golden path”. Matt will show concrete examples of application/cases where alternative solutions could be more appropriate and others where you are better off staying on the golden path.

More info: http://matt.aimonetti.net/posts/2009/05/08/railsconf-2009/

Matt Aimonetti

May 06, 2009
Tweet

More Decks by Matt Aimonetti

Other Decks in Programming

Transcript

  1. WHO AM I? m a t t a i m

    o n e t t i Wednesday, May 6, 2009
  2. WHO AM I? m a t t a i m

    o n e t t i “morally loose, cheese eating surrender monkey” Wednesday, May 6, 2009
  3. WHO AM I? m a t t a i m

    o n e t t i “morally loose, cheese eating surrender monkey” Ted Han Wednesday, May 6, 2009
  4. WHO AM I? m a t t a i m

    o n e t t i “morally loose, cheese eating surrender monkey” Ted Han Ruby Addict Wednesday, May 6, 2009
  5. WHO AM I? m a t t a i m

    o n e t t i “morally loose, cheese eating surrender monkey” Ted Han Merb Ruby Addict Wednesday, May 6, 2009
  6. WHO AM I? m a t t a i m

    o n e t t i “morally loose, cheese eating surrender monkey” Ted Han Merb Rails Ruby Addict Wednesday, May 6, 2009
  7. WHO AM I? m a t t a i m

    o n e t t i “morally loose, cheese eating surrender monkey” Ted Han Merb Rails MacRuby Ruby Addict Wednesday, May 6, 2009
  8. CECI N’EST PAS LA RÉALITÉ Rails 2 assert_equal(true, AwesomeApp.success?) html,

    xml, json, js ActiveRecord ERB Wednesday, May 6, 2009
  9. CECI N’EST PAS LA RÉALITÉ Rails 2 assert_equal(true, AwesomeApp.success?) html,

    xml, json, js ActiveRecord Test::Unit ERB Wednesday, May 6, 2009
  10. RAILS 3 DEFAULT STACK • ORM: ActiveRecord • JS: Prototype

    • Templating: ERB • Testing: Test::Unit Wednesday, May 6, 2009
  11. RAILS 3 - DEFAULT STACK assert_equal(true, AwesomeApp.success?) html, xml, json,

    js ActiveRecord Test::Unit ERB Wednesday, May 6, 2009
  12. Use default stack? Rails 3 default stack Is there a

    reason not to use it? Y is it a question of taste? Use the default stack and stop overthinking things N Y is it worth it? Rails 3 custom stack evaluate your requirements: templating, JS, ORM, Performance N N Y is it worth it? Y N Wednesday, May 6, 2009
  13. RAW SQL SELECT * FROM Book WHERE price > 100.00

    ORDER BY title; Wednesday, May 6, 2009
  14. DATAMAPPER db drivers using 1 unified interface Copyright - Merb

    in Action - Manning Wednesday, May 6, 2009
  15. DATAMAPPER • procrastination as a value • Lazy Loading •

    Strategic Eager Loader Wednesday, May 6, 2009
  16. ACTIVERECORD SELECT * FROM "students" SELECT * FROM "books" WHERE

    ("books".student_id = 1) SELECT * FROM "books" WHERE ("books".student_id = 2) SELECT * FROM "books" WHERE ("books".student_id = 3) SELECT * FROM "books" WHERE ("books".student_id = X) students = Student.all students.each do |student| student.books.map{|b| b.name} end Wednesday, May 6, 2009
  17. DATAMAPPER students = Student.all students.each do |student| student.books.map{|b| b.name} end

    SELECT "id", "name" FROM "students" ORDER BY "id" SELECT "id", "name", "student_id" FROM "books" WHERE ("student_id" IN (1, 2, 3, X)) ORDER BY "id" Wednesday, May 6, 2009
  18. MULTIPLE REPOS production: adapter: mysql encoding: utf8 database: production-app username:

    root password: top-s3ckrit host: localhost repositories: nightly_backup: adapter: sqlite3 database: shared/nightly.db weekly_backup: adapter: sqlite3 database: shared/weekly.db Wednesday, May 6, 2009
  19. MULTIPLE REPOS class Page include DataMapper::Resource property :id, Serial property

    :name, String repository(:legacy) do property :name, String, :field => "title" end end Wednesday, May 6, 2009
  20. QUERY::PATH Person.all("addresses.street.like" => "%street%" ) SELECT "people"."id", "people"."name" FROM "people"

    INNER JOIN "addresses" ON ("people"."id" = "addresses"."person_id") WHERE ("addresses"."street" LIKE '%street%') ORDER BY "people"."id" Find all people with an address that has street in the street name Wednesday, May 6, 2009
  21. ADAPTERS RDBMS file system IMAP Sales Force YAML REST APIs

    custom APIs ... Wednesday, May 6, 2009
  22. SEQUEL • Prepared Statements • Sharding • highly customizable SQL

    work • high performance Wednesday, May 6, 2009
  23. NON RDBMS SYSTEMS • AppEngine::Datastore • CouchDB with CouchRest or

    other DSL • Redis, Tokyo Cabinet etc... Wednesday, May 6, 2009
  24. CREATE YOUR OWN RAILS • define your own file structure

    • define your own router DSL • define your own ways to deal with requests Wednesday, May 6, 2009
  25. EXTEND ACTIONCONTROLER class Presentation < ActionController::Http def index self.response_body =

    "Rails3 + MacRuby" end end Presentation.action(:index).call \ Rack::MockRequest.env_for("/railsconf10") Wednesday, May 6, 2009
  26. credits: http://www.flickr.com/photos/dotdoubledot/ Katsushika Hokusai Delacroix Benetton http://www.rubyist.net/~matz/slides/oscon2003 Matt Groening http://www.flickr.com/photos/derricksphotos/

    http://www.flickr.com/photos/bogdansuditu http://www.flickr.com/photos/77096872@N00/2547160291/ http://www.flickr.com/photos/edvvc/1972546648/ http://www.flickr.com/photos/amagill/34762677/ http://www.flickr.com/photos/celinesphotographer/360918623/ Wednesday, May 6, 2009
  27. Thanks Heidi Vega Rails team Yehuda Katz Carl Lerche Laurent

    Sansonetti Rich Kilmer Ninh Hernandez Bui Hongli not-so-MacLovin’ Lai Dan Kubb Wednesday, May 6, 2009