SlideShare ist ein Scribd-Unternehmen logo
1 von 71
Downloaden Sie, um offline zu lesen
Workin’ on the
 Rails Road
           Obie Fernandez
   Original presentation delivered to the

Object Technology User Group
    St. Paul / Minneapolis
           September 20th 2005
Agenda
 Introduction to Ruby Programming
 Ruby on Rails Fundamentals and
  Interactive Demonstration
 Break
 Working in Ruby and Rails
 Is Rails Ready for Prime Time?
 Questions and Answers
Questions and Slides
 Ask questions at any time
 Slides and samples will be
  available online at
  obiefernandez.com
 I’ll show that address and others
  again at the end
Introduction to
 Ruby Programming
“Smalltalk was one of the main influences for
 Ruby. Whenever you find a main difference
between Perl and Ruby there's a good chance
      to find this feature in Smalltalk.”
                 RubyGarden
What is Ruby?
 Object-Oriented scripting language
 Conceptual similarities to Smalltalk
 Many system and text manipulation
  features like Perl
 Emphasis on simplicity and design
  elegance
Ruby is a Dynamic
Language
 Completely Object-Oriented
   All data is an object, no exceptions
   Operators are methods
 Dynamic Behavior
   Possible to add new classes, add or redefine
    methods at runtime
   An instance of one class can behave
    differently than another instance of the same
    class at runtime
Powerful Features
 Single Inheritance, but…
   Modules provide namespaces and allow
    ‘mixin’ capability
   A module is a collection of methods and
    constants
 Ruby has blocks
   Code surrounded by do…end or { … }
   They are true closures; get variable bindings
   Are passed to methods quite often
Ruby Variables
 Don’t need declaration
 Variable scope determined by
  naming convention
   foo … local variable
   @foo … instance variable
   $foo … global variable
   Foo or FOO … constant
Variable Assignment
 An assignment sets the rvalue to the
  lvalue
 Then it returns the that value as the
  result of the assignment expression
 Assigning to a variable or constant is
  hardwired into Ruby
 Assigning to an object attribute is a
  method call
 Parallel assignment
Strings
 String
   Instances usually created with literal
    expressions
   Sequences of 8-bit bytes
   Printable characters or not, doesn’t matter
   Over 75 standard methods
 Symbol
   Denoted by colon, like :foobar
   Basically an interned string, always the same
    instance no matter where used in codebase
Regular Expressions
Ruby supports Perl-style regular expressions…

  # Extract the parts of a phone number
  phone = quot;123-456-7890quot;
   
  if phone =~ /(d{3})-(d{3})-(d{4})/
    ext  = $1
    city = $2
    num  = $3
  End
Arrays and Hashes
 Array
   Ordered collection of references
   Literal is list of objects between square
    brackets
 Hash
      Used extensively in practice
  
      Any type of object can be used as index
  
      Elements are not ordered
  
      Literal form is key/value pairs enclosed in {…}
  
      using => to map keys to values
Numerics
 Integer
   Small integers are Fixnum, up to size of a
    native machine word minus 1 bit
   Big integers are Bignum, up to size of
    available memory
   Conversion happens automatically
 Float
   Real numbers
   Uses native double-precision floating-point
    representation
Ruby Methods
 Only way to change an object’s state
 Use def keyword and start with
  lowercase letter
 Use trailing ? for queries and ! for
  dangerous methods
 Use trailing = for methods that take
  assignment
Writing Methods
 Default values for parameters supported
 Variable-length argument lists by placing
  an asterisk on the last parameter
 Methods accept blocks implicitly or via
  the last parameter being prefixed with an
  ampersand
 Every called method returns the value of
  the last expression. Explicit use of return
  statement is optional
Calling Methods
  Specify receiver, name of method

  Parameters and block optional

  Parentheses optional

  Leaving off receiver defaults to

  current object
 No ‘keyword arguments’ but
  commonly accomplished with
  hashes
Access Control
 Determined dynamically
 Public is the default except for
  initialize method
 Protected
   Access by any instance of class
   Includes subclasses
 Private methods can be called only
  in the context of the current object
Conditionals
 Boolean expressions
   Any value that is not nil or the constant
    false is true
   && and || operators are shorcircuiting
   defined? operator checks its parameter
   ||= is a common idiom to assign a
    default value to a nil element
If and Unless
 Similar to other languages - if, then,
  elsif, else, end
 unless is negated form
 then is mandatory only on a single-
  line if statement
 tack on to end of normal statement
  to use as conditional modifiers
Iterators
 while and until are built-in
 for … in is syntactic sugar,
  translated automatically to a call
  to the each iterator method
 Other iterators are times, upto,
  downto, and step and work with
  numerics
Exceptions
 Ruby has hierarchy of exceptions
   Catch them using begin, rescue, ensure, and end
   Define multiple rescue clauses or specify more than
    one exception to catch as parameters
   Exception object is available as $! or use hash notation
    to assign variable names on the rescue clause
 Use retry after attempting to fix an exception to
  rerun the begin clause
 Throw exceptions in your own code by using a
  raise statement
 Subclass StandardError or one of its children
Memory Model
 Garbage Collection
   True mark-and-sweep
   Works with all Ruby objects
 Multithreading
   In-process inside the interpreter
   Completely portable
   Some negatives like not taking
    advantage of multi-processor hosts
More Language Features
 Portable
   OS independent threading
   Can load extension libraries
    dynamically
 Library support
   RubyGems package manager
   Tons of high-quality open source
    libraries available at RubyForge (similar
    to CPAN for Perl)
Ruby Tools
The following tools are included
 with the Ruby distribution
  debugger
  irb – interactive ruby shell
  benchmark
  profiler
  rdoc
The Pickaxe Book
Ruby on Rails
     Fundamentals
    “Rails is a full-stack, open-source web
  framework in Ruby for writing real-world
applications with joy and less code than most
    frameworks spend doing XML sit-ups”
       Rails Creator - David H. Hansson
What Is Rails?
‘Kitchen Sink’ MVC Web
  Application Framework written
  in Ruby
  ActiveRecord API
  ActionController API
  Templating Engine
  Scripts and lots of other stuff…
Big Productivity Gains
 Convention over configuration
 Everything is in Ruby
 Imposes strong design
  constraints
 Generators for creating code
  skeletons and scaffolding
Rails Models
ActiveRecord Model Classes
  Encapsulate persistence logic
  Contain business rules
  Tightly coupled to database tables
  Declare relationships to each other
ActiveRecord Basics
 Extend ActiveRecord::Base
 Don’t declare properties
 Declare relationships to other
  models with the following ‘macros’
   belongs_to
   has_many
   has_and_belongs_to_many (joins)
Rails Views
User interface done with templates
   HTML with Ruby snippets in .rhtml files
   Easy XML generation in .rxml files
   Lots of HTML and AJAX helper methods
   Sophisticated layout and ‘partials’
    functionality
ERB Template Example
XML Builder Example
Rails
Controllers
Process requests via action
 methods that map to URL
  Interact with model classes
  Set any data needed by view as
   field variables
  Select view to render or redirect
Controller Basics
 Extend ActionController:Base
 Request parameters in ‘params’
   Naming conventions mean Rails can
    translate paramaters into a hashtable
   Handles multi-dimensional data in
    forms pretty easily
 Web session in ‘session’ hash
 Redirect scope available in ‘flash’
  hash for next request only
Actually Working
with Ruby on Rails

Based on real-world
 project experience
Real Productivity Gains
Possible
Your results may vary!
 How many developers on team?
 Proficient with Ruby?
 Proficient with Rails?
 Greenfield project or trying to
  adapt to legacy data sources?
Rails Doesn’t Make Data
Modeling Any Easier
 Stabilize your schema before
  ramping up UI development
 Bootstrap your db schema with
  a migration script
 Write an exampledb rake task
Speaking of Rake
 Dependency-based programming
 So much better than Ant you’ll
  want to use it on all your projects
 Martin Fowler wrote a great
  article about it at http://
 martinfowler.com/articles/rake.html
Not much IDE support…
No Intellij for Ruby and none on the
 horizon for awhile
   Current Ruby editors are kind of crappy
   Eclipse RDT is starting to improve but
    not there yet (IMHO)
   The nature of dynamically-typed
    languages means you might want to
    just use a good text-editor instead
… how to deal with it
 Testing, testing, testing
 Use IRB, the interactive console
 Pair-programming very useful
 Keep Pickaxe and Rails books handy
 ri – command-line documentation
Unit Tests Crucial
 Once you start getting beyond CRUD
  features you better unit test
 The lack of static typing will get you
  if you’re not used to it
 It’s a big namespace so watch out
  for your code colliding with Rails
  methods or magic
Learning Ruby
 Think about syntax, cause your
  editor won’t
 Learn to use the debugger
  instead of ‘puts’ing around
 Blocks are very powerful. Learn
  how to use them
Learning Rails
 Don’t overcommit based on
  initial enthusiasm
 Easy to get started, but there is
  a learning curve
 Read the Rails book
You’ll Write Less Code
 Let Rails do the heavy lifting for you
  under the scenes
 Ruby is significantly less verbose
  than Java and C#
 Take advantage of…
   Convention over configuration
   Ruby lends itself to writing DSL
Don’t Repeat Yourself
 Refactor, refactor, refactor!
   Move repetitive view code into helpers
   Consolidate common page chunks into
    partials
 Rails has A LOT of built-in
  functionality (which you won’t know
  about as a beginner)
Don’t Reinvent the
Wheel
 Form helpers are your friend
 Rails ‘acts_as’ methods are very
  useful
 Look for RAA and RubyForge
  libraries, particularly to
  integrate to web services
ActiveRecord Reminder
“When you have this static view of the
 database, expressed in terms of n
 classes to match your n tables, then
 you tend to solve your problems in
 those precise terms, because the
 code generated by the O/R code
 generation tools will encourage (and
 perhaps even enforce) such
 behavior.” - Brad Wilson
Take Advantage of
ActiveRecord Flexibility
 Remember ActiveRecord works at runtime
  and doesn’t enforce those static views of
  your data
 The ActiveRecord pattern itself
  encourages addition of meaningful finder
  methods like find_specials
 Custom SQL queries can cause additional
  columns to get “tacked on” to returned
  objects without extra effort.
 (like for aggregate and other types of calculated columns
 defined in your SQL select statement)
Belongs_to Table Must
Have the Foreign Key
 This can really trip you up, even
  though it’s repeated multiple times
  in the docs
 The term “belongs to” is admittedly
  confusing
 Consider it as “references” or “has
  reference to”
Don’t Abuse HABTM
Speaking from experience…
 has_and_belongs_to_many can be pretty
  difficult to understand and use effectively
 Prefer simple has_many/belongs_to
  relationships where possible
 Once you start adding attributes to the
  join table, ask yourself if that join actually
  wants to be a first-class object
ActionMailer Notes
 ActionMailer works great for
  sending email, particularly the
  integration with templating
 Receiving email is still
  nightmarish depending on your
  platform configuration
AJAX is Easier With
Rails but…
 Some of the documentation is poor
 You still have to understand
  JavaScript to use it effectively
 There are definite “dos and don’ts”
  around where and why to use AJAX
Other Gotchas
 Learning where it’s okay to use
  symbols instead of strings
  tricky
 Lots of methods take hash of
  parameters and it’s easy to
  mistype one
 ‘Whiny Nil’ is annoying
Are Ruby and
  Rails Ready for
   Prime Time?
No simple answers, so
   let’s discuss it…
The Future of Ruby
“It sure looks like more than a fad to me.” - Tim Bray
 10 years of continual development and
  refinement will continue
 Ruby 2.0 is on the horizon
 No Microsoft or Sun Microsystems
  stupidity to ruin things 
 Compare with Python adoption rates
 Dynamic languages in general gaining
  wider acceptance in the enterprise
Road to Rails 1.0
80 issues pending (as of 9/20/2005)
 http://dev.rubyonrails.com/report/9
   Internationalization tops the list
   Several issues address developer-
    friendliness with error messages and
    unknown parameters to API calls
   Minor bugs with acts_as_ features
   RC might be available in October ‘05
Softer Issues
 Am I ready for a new language
  and development style?
 Is my team ready?
 Is my company ready?
 Do I have the right projects?
Common Apprehensions

Mostly concerns about ‘-ilities’
 Maintainability
   Future availability of Ruby programmers?
   Quality/readability of code?
   Platform support?
 Scalability
   Horizontal vs. Vertical scaling
   Performance concerns
Is Ruby better than..?
 Better at what?
 Some situations need one tool, other
  situations another tool.
 Performance-wise Ruby is probably
  slower than Java or C# in real-world
  situations
 Is it worth worrying about relative
  performance?
Pragmatic Dave on J2EE

“Using the full might of a J2EE
 stack to write a small stand-
 alone application is using a
 sledgehammer to crack a nut. But
 I keep hearing the sound of nuts being
 pulverized as developers seem to think
 that using anything other than J2EE is
 somehow unprofessional.”
More Pragmatic Dave
“I’d rather write in a language that let’s
   me focus on the application, and
   which lets me express myself clearly
   and effectively.”
“A better algorithm will easily gain
   back any marginal performance hit I
   take for using a slower language.”
 Posted on http://blogs.pragprog.com/
J2EE Backlash Fueling
Interest in Rails
 “Enterprise Java, has grown
  into a complex behemoth
  that consists of layer upon
  layer of complexity”
 David Geary, author of the best-selling
 book on Java Server Faces (JSF)
Web 2.0 and Rails
 Fast time-to-market
 Tight integration with AJAX libraries
 New emphasis on focused,
  interoperable applications
 Less time coding infrastructure
  means more emphasis on clean
  design and elegance in all aspects of
  the application
When should I use Rails?
 Small developer-focused
  applications
 Opportunities to do parallel
  development as proof of
  productivity impact
 Once you are comfortable with
  Ruby and Rails programming
When not to use Rails!
 Really large applications
 Dealing with legacy databases.
 Hibernate is much better for
 “schemas-from-hell”
 Unenthusiastic or mediocre
  developers won’t “get it”
The Right Developer
Attitude is Crucial
“Agile teams get Ruby on Rails
 sooner than traditional ones”
 Ruby on Rails increases productivity
  and sheer joy of development
 Reality is some programmers simply
  don’t care about that
Ruby on Rails and
Consulting Businesses
 Expect web design shops to
  continue moving into Rails and
  away from PHP (it’s just too
  much better not to do so)
 Faster projects with less people
  means larger consulting firms
  might have trouble adapting!
Future of Ruby on Rails
 Ruby is what makes Rails special, the
  interest in general Ruby programming
  will continue to expand rapidly
 Tons of similar projects popping up, but
  none with mindshare and critical mass of
  Rails project
 Integration of dynamic languages such as
  Ruby with Semantic Web technologies
  such as RDF holds significant promise
Questions and
 Comments
In Conclusion…
Thank you for coming to the presentation!
 Rails has a large enthusiastic
  community at rubyonrails.org
 ThoughtWorks is seeking Ruby on
  Rails enterprise projects
 I blog regularly about Rails and agile
  enterprise topics at
  obiefernandez.com
 I love getting email…
  obiefernandez@gmail.com

Weitere ähnliche Inhalte

Was ist angesagt?

30 Minutes To CPAN
30 Minutes To CPAN30 Minutes To CPAN
30 Minutes To CPANdaoswald
 
Quick Intro To JRuby
Quick Intro To JRubyQuick Intro To JRuby
Quick Intro To JRubyFrederic Jean
 
Security Goodness with Ruby on Rails
Security Goodness with Ruby on RailsSecurity Goodness with Ruby on Rails
Security Goodness with Ruby on RailsSource Conference
 
How to develop Jenkins plugin using to ruby and Jenkins.rb
How to develop Jenkins plugin using to ruby and Jenkins.rbHow to develop Jenkins plugin using to ruby and Jenkins.rb
How to develop Jenkins plugin using to ruby and Jenkins.rbHiroshi SHIBATA
 
J Ruby Whirlwind Tour
J Ruby Whirlwind TourJ Ruby Whirlwind Tour
J Ruby Whirlwind Touroscon2007
 
Getting started with Perl XS and Inline::C
Getting started with Perl XS and Inline::CGetting started with Perl XS and Inline::C
Getting started with Perl XS and Inline::Cdaoswald
 
PECL Picks - Extensions to make your life better
PECL Picks - Extensions to make your life betterPECL Picks - Extensions to make your life better
PECL Picks - Extensions to make your life betterZendCon
 
Introduction to Ruby on Rails
Introduction to Ruby on RailsIntroduction to Ruby on Rails
Introduction to Ruby on RailsAgnieszka Figiel
 
Ruby on Rails Training - Module 1
Ruby on Rails Training - Module 1Ruby on Rails Training - Module 1
Ruby on Rails Training - Module 1Mark Menard
 
Plack perl superglue for web frameworks and servers
Plack perl superglue for web frameworks and serversPlack perl superglue for web frameworks and servers
Plack perl superglue for web frameworks and serversTatsuhiko Miyagawa
 
Getting started with Catalyst and extjs
Getting started with Catalyst and extjsGetting started with Catalyst and extjs
Getting started with Catalyst and extjsPeter Edwards
 
Leave end-to-end testing to Capybara
Leave end-to-end testing to CapybaraLeave end-to-end testing to Capybara
Leave end-to-end testing to CapybaraHiroshi SHIBATA
 
O que há de novo no Rails 3
O que há de novo no Rails 3O que há de novo no Rails 3
O que há de novo no Rails 3Hugo Baraúna
 
Practical catalyst
Practical catalystPractical catalyst
Practical catalystdwm042
 
Remedie: Building a desktop app with HTTP::Engine, SQLite and jQuery
Remedie: Building a desktop app with HTTP::Engine, SQLite and jQueryRemedie: Building a desktop app with HTTP::Engine, SQLite and jQuery
Remedie: Building a desktop app with HTTP::Engine, SQLite and jQueryTatsuhiko Miyagawa
 
Gate of Agile Web Development
Gate of Agile Web DevelopmentGate of Agile Web Development
Gate of Agile Web DevelopmentKoichi ITO
 
Docker for Developers - PHP Detroit 2018
Docker for Developers - PHP Detroit 2018Docker for Developers - PHP Detroit 2018
Docker for Developers - PHP Detroit 2018Chris Tankersley
 

Was ist angesagt? (20)

30 Minutes To CPAN
30 Minutes To CPAN30 Minutes To CPAN
30 Minutes To CPAN
 
Quick Intro To JRuby
Quick Intro To JRubyQuick Intro To JRuby
Quick Intro To JRuby
 
How DSL works on Ruby
How DSL works on RubyHow DSL works on Ruby
How DSL works on Ruby
 
Security Goodness with Ruby on Rails
Security Goodness with Ruby on RailsSecurity Goodness with Ruby on Rails
Security Goodness with Ruby on Rails
 
How to develop Jenkins plugin using to ruby and Jenkins.rb
How to develop Jenkins plugin using to ruby and Jenkins.rbHow to develop Jenkins plugin using to ruby and Jenkins.rb
How to develop Jenkins plugin using to ruby and Jenkins.rb
 
J Ruby Whirlwind Tour
J Ruby Whirlwind TourJ Ruby Whirlwind Tour
J Ruby Whirlwind Tour
 
Debugging on rails
Debugging on railsDebugging on rails
Debugging on rails
 
Getting started with Perl XS and Inline::C
Getting started with Perl XS and Inline::CGetting started with Perl XS and Inline::C
Getting started with Perl XS and Inline::C
 
PECL Picks - Extensions to make your life better
PECL Picks - Extensions to make your life betterPECL Picks - Extensions to make your life better
PECL Picks - Extensions to make your life better
 
Introduction to Ruby on Rails
Introduction to Ruby on RailsIntroduction to Ruby on Rails
Introduction to Ruby on Rails
 
Ruby on Rails Training - Module 1
Ruby on Rails Training - Module 1Ruby on Rails Training - Module 1
Ruby on Rails Training - Module 1
 
Intro to PSGI and Plack
Intro to PSGI and PlackIntro to PSGI and Plack
Intro to PSGI and Plack
 
Plack perl superglue for web frameworks and servers
Plack perl superglue for web frameworks and serversPlack perl superglue for web frameworks and servers
Plack perl superglue for web frameworks and servers
 
Getting started with Catalyst and extjs
Getting started with Catalyst and extjsGetting started with Catalyst and extjs
Getting started with Catalyst and extjs
 
Leave end-to-end testing to Capybara
Leave end-to-end testing to CapybaraLeave end-to-end testing to Capybara
Leave end-to-end testing to Capybara
 
O que há de novo no Rails 3
O que há de novo no Rails 3O que há de novo no Rails 3
O que há de novo no Rails 3
 
Practical catalyst
Practical catalystPractical catalyst
Practical catalyst
 
Remedie: Building a desktop app with HTTP::Engine, SQLite and jQuery
Remedie: Building a desktop app with HTTP::Engine, SQLite and jQueryRemedie: Building a desktop app with HTTP::Engine, SQLite and jQuery
Remedie: Building a desktop app with HTTP::Engine, SQLite and jQuery
 
Gate of Agile Web Development
Gate of Agile Web DevelopmentGate of Agile Web Development
Gate of Agile Web Development
 
Docker for Developers - PHP Detroit 2018
Docker for Developers - PHP Detroit 2018Docker for Developers - PHP Detroit 2018
Docker for Developers - PHP Detroit 2018
 

Andere mochten auch (6)

State Of Rails 05
State Of Rails 05State Of Rails 05
State Of Rails 05
 
Fisl6
Fisl6Fisl6
Fisl6
 
Secretsofrubyonrails
SecretsofrubyonrailsSecretsofrubyonrails
Secretsofrubyonrails
 
Ugo Cei Presentation
Ugo Cei PresentationUgo Cei Presentation
Ugo Cei Presentation
 
Extractingrails
ExtractingrailsExtractingrails
Extractingrails
 
Pursuitofbeauty
PursuitofbeautyPursuitofbeauty
Pursuitofbeauty
 

Ähnlich wie Workin On The Rails Road

Jumping Into Java Then!
Jumping Into Java Then!Jumping Into Java Then!
Jumping Into Java Then!mondodello
 
Workin ontherailsroad
Workin ontherailsroadWorkin ontherailsroad
Workin ontherailsroadJim Jones
 
WorkinOnTheRailsRoad
WorkinOnTheRailsRoadWorkinOnTheRailsRoad
WorkinOnTheRailsRoadwebuploader
 
Modern Webdevelopment With Ruby On Rails
Modern Webdevelopment With Ruby On RailsModern Webdevelopment With Ruby On Rails
Modern Webdevelopment With Ruby On RailsRobert Glaser
 
Ola Bini Evolving The Java Platform
Ola Bini Evolving The Java PlatformOla Bini Evolving The Java Platform
Ola Bini Evolving The Java Platformdeimos
 
Ruby Xml Mapping
Ruby Xml MappingRuby Xml Mapping
Ruby Xml MappingMarc Seeger
 
When To Use Ruby On Rails
When To Use Ruby On RailsWhen To Use Ruby On Rails
When To Use Ruby On Railsdosire
 
Software Engineering Thailand: Programming with Scala
Software Engineering Thailand: Programming with ScalaSoftware Engineering Thailand: Programming with Scala
Software Engineering Thailand: Programming with ScalaBrian Topping
 
Smart Client Development
Smart Client DevelopmentSmart Client Development
Smart Client DevelopmentTamir Khason
 
Ajax Tutorial
Ajax TutorialAjax Tutorial
Ajax Tutorialoscon2007
 
Ruby and Rails short motivation
Ruby and Rails short motivationRuby and Rails short motivation
Ruby and Rails short motivationjistr
 
PHP, the GraphQL ecosystem and GraphQLite
PHP, the GraphQL ecosystem and GraphQLitePHP, the GraphQL ecosystem and GraphQLite
PHP, the GraphQL ecosystem and GraphQLiteJEAN-GUILLAUME DUJARDIN
 
Ajax World2008 Eric Farrar
Ajax World2008 Eric FarrarAjax World2008 Eric Farrar
Ajax World2008 Eric Farrarrajivmordani
 
Introduction to Scala JS
Introduction to Scala JSIntroduction to Scala JS
Introduction to Scala JSKnoldus Inc.
 
LAB PHP Consolidated.ppt
LAB PHP Consolidated.pptLAB PHP Consolidated.ppt
LAB PHP Consolidated.pptYasirAhmad80
 

Ähnlich wie Workin On The Rails Road (20)

Jumping Into Java Then!
Jumping Into Java Then!Jumping Into Java Then!
Jumping Into Java Then!
 
Workin ontherailsroad
Workin ontherailsroadWorkin ontherailsroad
Workin ontherailsroad
 
WorkinOnTheRailsRoad
WorkinOnTheRailsRoadWorkinOnTheRailsRoad
WorkinOnTheRailsRoad
 
Modern Webdevelopment With Ruby On Rails
Modern Webdevelopment With Ruby On RailsModern Webdevelopment With Ruby On Rails
Modern Webdevelopment With Ruby On Rails
 
Ola Bini Evolving The Java Platform
Ola Bini Evolving The Java PlatformOla Bini Evolving The Java Platform
Ola Bini Evolving The Java Platform
 
Ruby on Rails Presentation
Ruby on Rails PresentationRuby on Rails Presentation
Ruby on Rails Presentation
 
Ruby Xml Mapping
Ruby Xml MappingRuby Xml Mapping
Ruby Xml Mapping
 
When To Use Ruby On Rails
When To Use Ruby On RailsWhen To Use Ruby On Rails
When To Use Ruby On Rails
 
Software Engineering Thailand: Programming with Scala
Software Engineering Thailand: Programming with ScalaSoftware Engineering Thailand: Programming with Scala
Software Engineering Thailand: Programming with Scala
 
Smart Client Development
Smart Client DevelopmentSmart Client Development
Smart Client Development
 
Java script basics
Java script basicsJava script basics
Java script basics
 
L R U G - JRuby
L R U G - JRubyL R U G - JRuby
L R U G - JRuby
 
Ajax Tutorial
Ajax TutorialAjax Tutorial
Ajax Tutorial
 
Ruby and Rails short motivation
Ruby and Rails short motivationRuby and Rails short motivation
Ruby and Rails short motivation
 
Php basics
Php basicsPhp basics
Php basics
 
PHP, the GraphQL ecosystem and GraphQLite
PHP, the GraphQL ecosystem and GraphQLitePHP, the GraphQL ecosystem and GraphQLite
PHP, the GraphQL ecosystem and GraphQLite
 
Ajax World2008 Eric Farrar
Ajax World2008 Eric FarrarAjax World2008 Eric Farrar
Ajax World2008 Eric Farrar
 
Why Use Rails by Dr Nic
Why Use Rails by  Dr NicWhy Use Rails by  Dr Nic
Why Use Rails by Dr Nic
 
Introduction to Scala JS
Introduction to Scala JSIntroduction to Scala JS
Introduction to Scala JS
 
LAB PHP Consolidated.ppt
LAB PHP Consolidated.pptLAB PHP Consolidated.ppt
LAB PHP Consolidated.ppt
 

Mehr von RubyOnRails_dude

Mehr von RubyOnRails_dude (8)

Slides
SlidesSlides
Slides
 
Rails Conf Talk Slides
Rails Conf Talk SlidesRails Conf Talk Slides
Rails Conf Talk Slides
 
Thomas Fuchs Presentation
Thomas Fuchs PresentationThomas Fuchs Presentation
Thomas Fuchs Presentation
 
Marcel Molina Jr. Presentation
Marcel Molina Jr. PresentationMarcel Molina Jr. Presentation
Marcel Molina Jr. Presentation
 
Rails4 Days
Rails4 DaysRails4 Days
Rails4 Days
 
Programminghappiness
ProgramminghappinessProgramminghappiness
Programminghappiness
 
Dan Webb Presentation
Dan Webb PresentationDan Webb Presentation
Dan Webb Presentation
 
Worldofresources
WorldofresourcesWorldofresources
Worldofresources
 

Kürzlich hochgeladen

Guide Complete Set of Residential Architectural Drawings PDF
Guide Complete Set of Residential Architectural Drawings PDFGuide Complete Set of Residential Architectural Drawings PDF
Guide Complete Set of Residential Architectural Drawings PDFChandresh Chudasama
 
FULL ENJOY Call girls in Paharganj Delhi | 8377087607
FULL ENJOY Call girls in Paharganj Delhi | 8377087607FULL ENJOY Call girls in Paharganj Delhi | 8377087607
FULL ENJOY Call girls in Paharganj Delhi | 8377087607dollysharma2066
 
Ten Organizational Design Models to align structure and operations to busines...
Ten Organizational Design Models to align structure and operations to busines...Ten Organizational Design Models to align structure and operations to busines...
Ten Organizational Design Models to align structure and operations to busines...Seta Wicaksana
 
PSCC - Capability Statement Presentation
PSCC - Capability Statement PresentationPSCC - Capability Statement Presentation
PSCC - Capability Statement PresentationAnamaria Contreras
 
Fordham -How effective decision-making is within the IT department - Analysis...
Fordham -How effective decision-making is within the IT department - Analysis...Fordham -How effective decision-making is within the IT department - Analysis...
Fordham -How effective decision-making is within the IT department - Analysis...Peter Ward
 
The-Ethical-issues-ghhhhhhhhjof-Byjus.pptx
The-Ethical-issues-ghhhhhhhhjof-Byjus.pptxThe-Ethical-issues-ghhhhhhhhjof-Byjus.pptx
The-Ethical-issues-ghhhhhhhhjof-Byjus.pptxmbikashkanyari
 
Flow Your Strategy at Flight Levels Day 2024
Flow Your Strategy at Flight Levels Day 2024Flow Your Strategy at Flight Levels Day 2024
Flow Your Strategy at Flight Levels Day 2024Kirill Klimov
 
Investment in The Coconut Industry by Nancy Cheruiyot
Investment in The Coconut Industry by Nancy CheruiyotInvestment in The Coconut Industry by Nancy Cheruiyot
Investment in The Coconut Industry by Nancy Cheruiyotictsugar
 
MAHA Global and IPR: Do Actions Speak Louder Than Words?
MAHA Global and IPR: Do Actions Speak Louder Than Words?MAHA Global and IPR: Do Actions Speak Louder Than Words?
MAHA Global and IPR: Do Actions Speak Louder Than Words?Olivia Kresic
 
Memorándum de Entendimiento (MoU) entre Codelco y SQM
Memorándum de Entendimiento (MoU) entre Codelco y SQMMemorándum de Entendimiento (MoU) entre Codelco y SQM
Memorándum de Entendimiento (MoU) entre Codelco y SQMVoces Mineras
 
Marketplace and Quality Assurance Presentation - Vincent Chirchir
Marketplace and Quality Assurance Presentation - Vincent ChirchirMarketplace and Quality Assurance Presentation - Vincent Chirchir
Marketplace and Quality Assurance Presentation - Vincent Chirchirictsugar
 
Cybersecurity Awareness Training Presentation v2024.03
Cybersecurity Awareness Training Presentation v2024.03Cybersecurity Awareness Training Presentation v2024.03
Cybersecurity Awareness Training Presentation v2024.03DallasHaselhorst
 
Kenya Coconut Production Presentation by Dr. Lalith Perera
Kenya Coconut Production Presentation by Dr. Lalith PereraKenya Coconut Production Presentation by Dr. Lalith Perera
Kenya Coconut Production Presentation by Dr. Lalith Pereraictsugar
 
Unlocking the Future: Explore Web 3.0 Workshop to Start Earning Today!
Unlocking the Future: Explore Web 3.0 Workshop to Start Earning Today!Unlocking the Future: Explore Web 3.0 Workshop to Start Earning Today!
Unlocking the Future: Explore Web 3.0 Workshop to Start Earning Today!Doge Mining Website
 
Traction part 2 - EOS Model JAX Bridges.
Traction part 2 - EOS Model JAX Bridges.Traction part 2 - EOS Model JAX Bridges.
Traction part 2 - EOS Model JAX Bridges.Anamaria Contreras
 
Market Sizes Sample Report - 2024 Edition
Market Sizes Sample Report - 2024 EditionMarket Sizes Sample Report - 2024 Edition
Market Sizes Sample Report - 2024 EditionMintel Group
 
NewBase 19 April 2024 Energy News issue - 1717 by Khaled Al Awadi.pdf
NewBase  19 April  2024  Energy News issue - 1717 by Khaled Al Awadi.pdfNewBase  19 April  2024  Energy News issue - 1717 by Khaled Al Awadi.pdf
NewBase 19 April 2024 Energy News issue - 1717 by Khaled Al Awadi.pdfKhaled Al Awadi
 
8447779800, Low rate Call girls in Uttam Nagar Delhi NCR
8447779800, Low rate Call girls in Uttam Nagar Delhi NCR8447779800, Low rate Call girls in Uttam Nagar Delhi NCR
8447779800, Low rate Call girls in Uttam Nagar Delhi NCRashishs7044
 
Global Scenario On Sustainable and Resilient Coconut Industry by Dr. Jelfina...
Global Scenario On Sustainable  and Resilient Coconut Industry by Dr. Jelfina...Global Scenario On Sustainable  and Resilient Coconut Industry by Dr. Jelfina...
Global Scenario On Sustainable and Resilient Coconut Industry by Dr. Jelfina...ictsugar
 

Kürzlich hochgeladen (20)

Guide Complete Set of Residential Architectural Drawings PDF
Guide Complete Set of Residential Architectural Drawings PDFGuide Complete Set of Residential Architectural Drawings PDF
Guide Complete Set of Residential Architectural Drawings PDF
 
FULL ENJOY Call girls in Paharganj Delhi | 8377087607
FULL ENJOY Call girls in Paharganj Delhi | 8377087607FULL ENJOY Call girls in Paharganj Delhi | 8377087607
FULL ENJOY Call girls in Paharganj Delhi | 8377087607
 
Ten Organizational Design Models to align structure and operations to busines...
Ten Organizational Design Models to align structure and operations to busines...Ten Organizational Design Models to align structure and operations to busines...
Ten Organizational Design Models to align structure and operations to busines...
 
No-1 Call Girls In Goa 93193 VIP 73153 Escort service In North Goa Panaji, Ca...
No-1 Call Girls In Goa 93193 VIP 73153 Escort service In North Goa Panaji, Ca...No-1 Call Girls In Goa 93193 VIP 73153 Escort service In North Goa Panaji, Ca...
No-1 Call Girls In Goa 93193 VIP 73153 Escort service In North Goa Panaji, Ca...
 
PSCC - Capability Statement Presentation
PSCC - Capability Statement PresentationPSCC - Capability Statement Presentation
PSCC - Capability Statement Presentation
 
Fordham -How effective decision-making is within the IT department - Analysis...
Fordham -How effective decision-making is within the IT department - Analysis...Fordham -How effective decision-making is within the IT department - Analysis...
Fordham -How effective decision-making is within the IT department - Analysis...
 
The-Ethical-issues-ghhhhhhhhjof-Byjus.pptx
The-Ethical-issues-ghhhhhhhhjof-Byjus.pptxThe-Ethical-issues-ghhhhhhhhjof-Byjus.pptx
The-Ethical-issues-ghhhhhhhhjof-Byjus.pptx
 
Flow Your Strategy at Flight Levels Day 2024
Flow Your Strategy at Flight Levels Day 2024Flow Your Strategy at Flight Levels Day 2024
Flow Your Strategy at Flight Levels Day 2024
 
Investment in The Coconut Industry by Nancy Cheruiyot
Investment in The Coconut Industry by Nancy CheruiyotInvestment in The Coconut Industry by Nancy Cheruiyot
Investment in The Coconut Industry by Nancy Cheruiyot
 
MAHA Global and IPR: Do Actions Speak Louder Than Words?
MAHA Global and IPR: Do Actions Speak Louder Than Words?MAHA Global and IPR: Do Actions Speak Louder Than Words?
MAHA Global and IPR: Do Actions Speak Louder Than Words?
 
Memorándum de Entendimiento (MoU) entre Codelco y SQM
Memorándum de Entendimiento (MoU) entre Codelco y SQMMemorándum de Entendimiento (MoU) entre Codelco y SQM
Memorándum de Entendimiento (MoU) entre Codelco y SQM
 
Marketplace and Quality Assurance Presentation - Vincent Chirchir
Marketplace and Quality Assurance Presentation - Vincent ChirchirMarketplace and Quality Assurance Presentation - Vincent Chirchir
Marketplace and Quality Assurance Presentation - Vincent Chirchir
 
Cybersecurity Awareness Training Presentation v2024.03
Cybersecurity Awareness Training Presentation v2024.03Cybersecurity Awareness Training Presentation v2024.03
Cybersecurity Awareness Training Presentation v2024.03
 
Kenya Coconut Production Presentation by Dr. Lalith Perera
Kenya Coconut Production Presentation by Dr. Lalith PereraKenya Coconut Production Presentation by Dr. Lalith Perera
Kenya Coconut Production Presentation by Dr. Lalith Perera
 
Unlocking the Future: Explore Web 3.0 Workshop to Start Earning Today!
Unlocking the Future: Explore Web 3.0 Workshop to Start Earning Today!Unlocking the Future: Explore Web 3.0 Workshop to Start Earning Today!
Unlocking the Future: Explore Web 3.0 Workshop to Start Earning Today!
 
Traction part 2 - EOS Model JAX Bridges.
Traction part 2 - EOS Model JAX Bridges.Traction part 2 - EOS Model JAX Bridges.
Traction part 2 - EOS Model JAX Bridges.
 
Market Sizes Sample Report - 2024 Edition
Market Sizes Sample Report - 2024 EditionMarket Sizes Sample Report - 2024 Edition
Market Sizes Sample Report - 2024 Edition
 
NewBase 19 April 2024 Energy News issue - 1717 by Khaled Al Awadi.pdf
NewBase  19 April  2024  Energy News issue - 1717 by Khaled Al Awadi.pdfNewBase  19 April  2024  Energy News issue - 1717 by Khaled Al Awadi.pdf
NewBase 19 April 2024 Energy News issue - 1717 by Khaled Al Awadi.pdf
 
8447779800, Low rate Call girls in Uttam Nagar Delhi NCR
8447779800, Low rate Call girls in Uttam Nagar Delhi NCR8447779800, Low rate Call girls in Uttam Nagar Delhi NCR
8447779800, Low rate Call girls in Uttam Nagar Delhi NCR
 
Global Scenario On Sustainable and Resilient Coconut Industry by Dr. Jelfina...
Global Scenario On Sustainable  and Resilient Coconut Industry by Dr. Jelfina...Global Scenario On Sustainable  and Resilient Coconut Industry by Dr. Jelfina...
Global Scenario On Sustainable and Resilient Coconut Industry by Dr. Jelfina...
 

Workin On The Rails Road

  • 1. Workin’ on the Rails Road Obie Fernandez Original presentation delivered to the Object Technology User Group St. Paul / Minneapolis September 20th 2005
  • 2. Agenda  Introduction to Ruby Programming  Ruby on Rails Fundamentals and Interactive Demonstration Break  Working in Ruby and Rails  Is Rails Ready for Prime Time?  Questions and Answers
  • 3. Questions and Slides  Ask questions at any time  Slides and samples will be available online at obiefernandez.com  I’ll show that address and others again at the end
  • 4. Introduction to Ruby Programming “Smalltalk was one of the main influences for Ruby. Whenever you find a main difference between Perl and Ruby there's a good chance to find this feature in Smalltalk.” RubyGarden
  • 5. What is Ruby?  Object-Oriented scripting language  Conceptual similarities to Smalltalk  Many system and text manipulation features like Perl  Emphasis on simplicity and design elegance
  • 6. Ruby is a Dynamic Language  Completely Object-Oriented  All data is an object, no exceptions  Operators are methods  Dynamic Behavior  Possible to add new classes, add or redefine methods at runtime  An instance of one class can behave differently than another instance of the same class at runtime
  • 7. Powerful Features  Single Inheritance, but…  Modules provide namespaces and allow ‘mixin’ capability  A module is a collection of methods and constants  Ruby has blocks  Code surrounded by do…end or { … }  They are true closures; get variable bindings  Are passed to methods quite often
  • 8. Ruby Variables  Don’t need declaration  Variable scope determined by naming convention  foo … local variable  @foo … instance variable  $foo … global variable  Foo or FOO … constant
  • 9. Variable Assignment  An assignment sets the rvalue to the lvalue  Then it returns the that value as the result of the assignment expression  Assigning to a variable or constant is hardwired into Ruby  Assigning to an object attribute is a method call  Parallel assignment
  • 10. Strings  String  Instances usually created with literal expressions  Sequences of 8-bit bytes  Printable characters or not, doesn’t matter  Over 75 standard methods  Symbol  Denoted by colon, like :foobar  Basically an interned string, always the same instance no matter where used in codebase
  • 11. Regular Expressions Ruby supports Perl-style regular expressions… # Extract the parts of a phone number phone = quot;123-456-7890quot;   if phone =~ /(d{3})-(d{3})-(d{4})/   ext  = $1   city = $2   num  = $3 End
  • 12. Arrays and Hashes  Array  Ordered collection of references  Literal is list of objects between square brackets  Hash Used extensively in practice  Any type of object can be used as index  Elements are not ordered  Literal form is key/value pairs enclosed in {…}  using => to map keys to values
  • 13. Numerics  Integer  Small integers are Fixnum, up to size of a native machine word minus 1 bit  Big integers are Bignum, up to size of available memory  Conversion happens automatically  Float  Real numbers  Uses native double-precision floating-point representation
  • 14. Ruby Methods  Only way to change an object’s state  Use def keyword and start with lowercase letter  Use trailing ? for queries and ! for dangerous methods  Use trailing = for methods that take assignment
  • 15. Writing Methods  Default values for parameters supported  Variable-length argument lists by placing an asterisk on the last parameter  Methods accept blocks implicitly or via the last parameter being prefixed with an ampersand  Every called method returns the value of the last expression. Explicit use of return statement is optional
  • 16. Calling Methods Specify receiver, name of method  Parameters and block optional  Parentheses optional  Leaving off receiver defaults to  current object  No ‘keyword arguments’ but commonly accomplished with hashes
  • 17. Access Control  Determined dynamically  Public is the default except for initialize method  Protected  Access by any instance of class  Includes subclasses  Private methods can be called only in the context of the current object
  • 18. Conditionals  Boolean expressions  Any value that is not nil or the constant false is true  && and || operators are shorcircuiting  defined? operator checks its parameter  ||= is a common idiom to assign a default value to a nil element
  • 19. If and Unless  Similar to other languages - if, then, elsif, else, end  unless is negated form  then is mandatory only on a single- line if statement  tack on to end of normal statement to use as conditional modifiers
  • 20. Iterators  while and until are built-in  for … in is syntactic sugar, translated automatically to a call to the each iterator method  Other iterators are times, upto, downto, and step and work with numerics
  • 21. Exceptions  Ruby has hierarchy of exceptions  Catch them using begin, rescue, ensure, and end  Define multiple rescue clauses or specify more than one exception to catch as parameters  Exception object is available as $! or use hash notation to assign variable names on the rescue clause  Use retry after attempting to fix an exception to rerun the begin clause  Throw exceptions in your own code by using a raise statement  Subclass StandardError or one of its children
  • 22. Memory Model  Garbage Collection  True mark-and-sweep  Works with all Ruby objects  Multithreading  In-process inside the interpreter  Completely portable  Some negatives like not taking advantage of multi-processor hosts
  • 23. More Language Features  Portable  OS independent threading  Can load extension libraries dynamically  Library support  RubyGems package manager  Tons of high-quality open source libraries available at RubyForge (similar to CPAN for Perl)
  • 24. Ruby Tools The following tools are included with the Ruby distribution  debugger  irb – interactive ruby shell  benchmark  profiler  rdoc
  • 26. Ruby on Rails Fundamentals “Rails is a full-stack, open-source web framework in Ruby for writing real-world applications with joy and less code than most frameworks spend doing XML sit-ups” Rails Creator - David H. Hansson
  • 27. What Is Rails? ‘Kitchen Sink’ MVC Web Application Framework written in Ruby  ActiveRecord API  ActionController API  Templating Engine  Scripts and lots of other stuff…
  • 28. Big Productivity Gains  Convention over configuration  Everything is in Ruby  Imposes strong design constraints  Generators for creating code skeletons and scaffolding
  • 29. Rails Models ActiveRecord Model Classes  Encapsulate persistence logic  Contain business rules  Tightly coupled to database tables  Declare relationships to each other
  • 30. ActiveRecord Basics  Extend ActiveRecord::Base  Don’t declare properties  Declare relationships to other models with the following ‘macros’  belongs_to  has_many  has_and_belongs_to_many (joins)
  • 31. Rails Views User interface done with templates  HTML with Ruby snippets in .rhtml files  Easy XML generation in .rxml files  Lots of HTML and AJAX helper methods  Sophisticated layout and ‘partials’ functionality
  • 34. Rails Controllers Process requests via action methods that map to URL  Interact with model classes  Set any data needed by view as field variables  Select view to render or redirect
  • 35. Controller Basics  Extend ActionController:Base  Request parameters in ‘params’  Naming conventions mean Rails can translate paramaters into a hashtable  Handles multi-dimensional data in forms pretty easily  Web session in ‘session’ hash  Redirect scope available in ‘flash’ hash for next request only
  • 36. Actually Working with Ruby on Rails Based on real-world project experience
  • 37. Real Productivity Gains Possible Your results may vary!  How many developers on team?  Proficient with Ruby?  Proficient with Rails?  Greenfield project or trying to adapt to legacy data sources?
  • 38. Rails Doesn’t Make Data Modeling Any Easier  Stabilize your schema before ramping up UI development  Bootstrap your db schema with a migration script  Write an exampledb rake task
  • 39. Speaking of Rake  Dependency-based programming  So much better than Ant you’ll want to use it on all your projects  Martin Fowler wrote a great article about it at http:// martinfowler.com/articles/rake.html
  • 40. Not much IDE support… No Intellij for Ruby and none on the horizon for awhile  Current Ruby editors are kind of crappy  Eclipse RDT is starting to improve but not there yet (IMHO)  The nature of dynamically-typed languages means you might want to just use a good text-editor instead
  • 41. … how to deal with it  Testing, testing, testing  Use IRB, the interactive console  Pair-programming very useful  Keep Pickaxe and Rails books handy  ri – command-line documentation
  • 42. Unit Tests Crucial  Once you start getting beyond CRUD features you better unit test  The lack of static typing will get you if you’re not used to it  It’s a big namespace so watch out for your code colliding with Rails methods or magic
  • 43. Learning Ruby  Think about syntax, cause your editor won’t  Learn to use the debugger instead of ‘puts’ing around  Blocks are very powerful. Learn how to use them
  • 44. Learning Rails  Don’t overcommit based on initial enthusiasm  Easy to get started, but there is a learning curve  Read the Rails book
  • 45. You’ll Write Less Code  Let Rails do the heavy lifting for you under the scenes  Ruby is significantly less verbose than Java and C#  Take advantage of…  Convention over configuration  Ruby lends itself to writing DSL
  • 46. Don’t Repeat Yourself  Refactor, refactor, refactor!  Move repetitive view code into helpers  Consolidate common page chunks into partials  Rails has A LOT of built-in functionality (which you won’t know about as a beginner)
  • 47. Don’t Reinvent the Wheel  Form helpers are your friend  Rails ‘acts_as’ methods are very useful  Look for RAA and RubyForge libraries, particularly to integrate to web services
  • 48. ActiveRecord Reminder “When you have this static view of the database, expressed in terms of n classes to match your n tables, then you tend to solve your problems in those precise terms, because the code generated by the O/R code generation tools will encourage (and perhaps even enforce) such behavior.” - Brad Wilson
  • 49. Take Advantage of ActiveRecord Flexibility  Remember ActiveRecord works at runtime and doesn’t enforce those static views of your data  The ActiveRecord pattern itself encourages addition of meaningful finder methods like find_specials  Custom SQL queries can cause additional columns to get “tacked on” to returned objects without extra effort. (like for aggregate and other types of calculated columns defined in your SQL select statement)
  • 50. Belongs_to Table Must Have the Foreign Key  This can really trip you up, even though it’s repeated multiple times in the docs  The term “belongs to” is admittedly confusing  Consider it as “references” or “has reference to”
  • 51. Don’t Abuse HABTM Speaking from experience…  has_and_belongs_to_many can be pretty difficult to understand and use effectively  Prefer simple has_many/belongs_to relationships where possible  Once you start adding attributes to the join table, ask yourself if that join actually wants to be a first-class object
  • 52. ActionMailer Notes  ActionMailer works great for sending email, particularly the integration with templating  Receiving email is still nightmarish depending on your platform configuration
  • 53. AJAX is Easier With Rails but…  Some of the documentation is poor  You still have to understand JavaScript to use it effectively  There are definite “dos and don’ts” around where and why to use AJAX
  • 54. Other Gotchas  Learning where it’s okay to use symbols instead of strings tricky  Lots of methods take hash of parameters and it’s easy to mistype one  ‘Whiny Nil’ is annoying
  • 55. Are Ruby and Rails Ready for Prime Time? No simple answers, so let’s discuss it…
  • 56. The Future of Ruby “It sure looks like more than a fad to me.” - Tim Bray  10 years of continual development and refinement will continue  Ruby 2.0 is on the horizon  No Microsoft or Sun Microsystems stupidity to ruin things   Compare with Python adoption rates  Dynamic languages in general gaining wider acceptance in the enterprise
  • 57. Road to Rails 1.0 80 issues pending (as of 9/20/2005) http://dev.rubyonrails.com/report/9  Internationalization tops the list  Several issues address developer- friendliness with error messages and unknown parameters to API calls  Minor bugs with acts_as_ features  RC might be available in October ‘05
  • 58. Softer Issues  Am I ready for a new language and development style?  Is my team ready?  Is my company ready?  Do I have the right projects?
  • 59. Common Apprehensions Mostly concerns about ‘-ilities’  Maintainability  Future availability of Ruby programmers?  Quality/readability of code?  Platform support?  Scalability  Horizontal vs. Vertical scaling  Performance concerns
  • 60. Is Ruby better than..?  Better at what?  Some situations need one tool, other situations another tool.  Performance-wise Ruby is probably slower than Java or C# in real-world situations  Is it worth worrying about relative performance?
  • 61. Pragmatic Dave on J2EE “Using the full might of a J2EE stack to write a small stand- alone application is using a sledgehammer to crack a nut. But I keep hearing the sound of nuts being pulverized as developers seem to think that using anything other than J2EE is somehow unprofessional.”
  • 62. More Pragmatic Dave “I’d rather write in a language that let’s me focus on the application, and which lets me express myself clearly and effectively.” “A better algorithm will easily gain back any marginal performance hit I take for using a slower language.” Posted on http://blogs.pragprog.com/
  • 63. J2EE Backlash Fueling Interest in Rails  “Enterprise Java, has grown into a complex behemoth that consists of layer upon layer of complexity” David Geary, author of the best-selling book on Java Server Faces (JSF)
  • 64. Web 2.0 and Rails  Fast time-to-market  Tight integration with AJAX libraries  New emphasis on focused, interoperable applications  Less time coding infrastructure means more emphasis on clean design and elegance in all aspects of the application
  • 65. When should I use Rails?  Small developer-focused applications  Opportunities to do parallel development as proof of productivity impact  Once you are comfortable with Ruby and Rails programming
  • 66. When not to use Rails!  Really large applications  Dealing with legacy databases. Hibernate is much better for “schemas-from-hell”  Unenthusiastic or mediocre developers won’t “get it”
  • 67. The Right Developer Attitude is Crucial “Agile teams get Ruby on Rails sooner than traditional ones”  Ruby on Rails increases productivity and sheer joy of development  Reality is some programmers simply don’t care about that
  • 68. Ruby on Rails and Consulting Businesses  Expect web design shops to continue moving into Rails and away from PHP (it’s just too much better not to do so)  Faster projects with less people means larger consulting firms might have trouble adapting!
  • 69. Future of Ruby on Rails  Ruby is what makes Rails special, the interest in general Ruby programming will continue to expand rapidly  Tons of similar projects popping up, but none with mindshare and critical mass of Rails project  Integration of dynamic languages such as Ruby with Semantic Web technologies such as RDF holds significant promise
  • 71. In Conclusion… Thank you for coming to the presentation!  Rails has a large enthusiastic community at rubyonrails.org  ThoughtWorks is seeking Ruby on Rails enterprise projects  I blog regularly about Rails and agile enterprise topics at obiefernandez.com  I love getting email… obiefernandez@gmail.com