Your SlideShare is downloading. ×
Ruby On Rails - Rochester K Linux User Group
Upcoming SlideShare
Loading in...5

Thanks for flagging this SlideShare!

Oops! An error has occurred.

Saving this for later? Get the SlideShare app to save on your phone or tablet. Read anywhere, anytime – even offline.
Text the download link to your phone
Standard text messaging rates apply

Ruby On Rails - Rochester K Linux User Group


Published on

Presentation on Ruby On Rails web framework for the Rochester (Minnesota) "K" Linux User Group

Presentation on Ruby On Rails web framework for the Rochester (Minnesota) "K" Linux User Group

Published in: Technology
  • Be the first to comment

No Downloads
Total Views
On Slideshare
From Embeds
Number of Embeds
Embeds 0
No embeds

Report content
Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

No notes for slide


  • 1. Ruby & Ruby on Rails José de Leon K-LUG July 13, 2006
  • 2. About Me
    • José de Leon
      • Career software developer, Problem-Solver by nature
        • Obsessed with “Finding the best way or best approach”
      • “ Good storyteller”
      • Interests:
        • Object-oriented development
        • User-experience, including developers
        • Best practices - what's worked well for others
        • Outside: pro basketball/sports, comics
      • Email: [email_address]
  • 3. About This Talk
    • History of Ruby & Rails
    • About Ruby
    • About Software Best Practices
    • How Rails Embodies Best Practices
    • Demos
    • RailsConf 2006
  • 4. History of Ruby on Rails
    • History of Ruby
    • History of Rails
  • 5. History of Ruby
    • Created by Yukihiro “Matz” Matsumoto in Japan, 1995
    • Inspired by Perl, LISP, and Smalltalk
    • Gained popularity outside Japan around 2000, when Programming Ruby (1 st ed) was published by Thomas and Hunt
  • 6. History of Rails
    • Conception of David Heinemeier-Hansson
    • Based on work derived from Basecamp, a web-based project-management application
    • Extracted as a distinct framework, Summer 2004
    • 1.0 release in December 2005
    “ Rails is a full-stack framework for developing database-backed web applications according to the Model-View-Control pattern.”
  • 7. About Ruby
    • Understanding Rails requires understanding Ruby
    • Ruby is a multi-paradigm, interpreted programming language :
      • Imperative
      • Object-oriented
      • Functional
    • Familiarity with Perl, Smalltalk, Java, LISP, C++ will be an asset
  • 8. About Ruby
    • Strong text-processing and regular-expression capabilities on a par with Perl
    • O-O/functional properties of Ruby allow you to write programs in as natural a language as spoken language
      • Ruby programs tend to be readable
      • Ruby has strong collections facilities
    • Ruby is a scripting-language
      • Programs can be developed in an incremental, interactive style with fast turnaround
  • 9. About Best Practices
    • Best thing about Rails: Embodies and enforces best practices and strong principles in designing software
  • 10. Frameworks Are Extractions
    • Rails is based on a successful web-based application, Basecamp
    • Consistently repeated motifs and patterns : extracted to create the basis for a framework
      • Drawn from real-life usage and experience
    • Opposes “Big Design Up-Front” (BDUF) approach to framework building
      • BDUF often leads to many libraries that few find useful
  • 11. Active Record Pattern
    • Maps rows in a database to objects in an application
    • Database fields are mapped to object attributes
    • Add “smart” operations for an object to interact with a database
      • 4 basic operations:
        • CREATE (INSERT)
        • UPDATE (UPDATE)
        • DESTROY (DELETE)
  • 12. Model-Controller-View
    • Separation of:
      • Data (Model)
      • Operations on Data (Controller):
        • Data manipulation
        • Data presentation
      • Presentation of Data (View)
  • 13. Test-Driven Development
    • Rails encourages you to write your tests as you develop
      • Create tests exercising one facet of your application:
        • Unit Tests: Essential operations on a single model
        • Functional Tests: Essential operations between a controller and model
        • Integration Tests: Interactions between several controllers and models (referring to Use-Cases)
  • 14. Other Best Practices
    • Emphasize Simplicity:
      • Principle Of Least-Surprise (POLS) AKA Law Of Least Astonishment (LOLA)
      • “Do the simplest thing that could possibly work”
    • Enable Refactoring
    • Don't Repeat Yourself (DRY)
    • Convention Over Configuration
      • Handle most common cases most easily, often by default
  • 15. How Rails Embodies Best Practices
    • Demo: Simple contact list
      • Strong application structure created for you
    • Ruby code is used at every level of development in the Rails framework:
      • DB creation and schema management (Migrations)
      • Build maintenance (Rake Tasks)
      • URL routing (Routes)
      • Content serving (Webrick, Mongrel)
  • 16. How Rails Embodies Best Practices
    • Rails presents a ready-to-use MCV architecture:
      • Model: ActiveRecord
      • Controller: ActionController
      • View: ActionView
    • ActionController includes controller equivalents (user actions) for ActiveRecord CRUD operations
    • ActionView can generate output for different media thru Ruby code:
      • RHTML: Plain text/html
      • RXML: XML, for Web Services (ActionWebService)
      • RJS: Javascript for AJAX
  • 17. Other Rails Features
    • Rails supports sub-frameworks for:
      • Testing
      • AJAX (several popular Javascript libraries are included)
      • Web services
      • Email (ActionMailer)
  • 18. Rails Applications
    • RadiantCMS
    • Blogging Engines:
      • Typo
      • Instiki (Wiki engine)
    • E-Commerce Tools:
      • RightCart (embedded shopping cart)
      • Shopify (hosted on-line stores)
  • 19. Rails vs Other Frameworks
    • Rails (and others) are a reflection of Agile Development techniques
      • Favored over bloated “Enterprise” solutions (JEE)
      • Covers “sweet spot” of web applications: web front-ends for a database
    • Rails competes with other frameworks:
      • Python: Django, TurboGears
      • Java: JEE stack, HSE, Trails, Grails
      • PHP, .NET
  • 20. Rails vs Other Frameworks
    • TurboGears and Java frameworks: combinations of existing products/projects:
      • SQLObject (model) CherryPy (view/controller) for TurboGears
      • Mix of Hibernate/iBatis/Spring (model/controller) Tapestry/Echo2/Spring MVC (view) etc. for Java/JEE
    • Django very close in philosophy of design with Rails
    • Agile techniques and practices worked into other technology stacks (.NET)
    • Ruby as a language has a lot going for it
  • 21. Demo
    • Garage Invoicing Application
      • Componentized approach
      • Techniques for chaining views and models
      • A little AJAX
      • Productivity gains, especially over Java
    C/C++ Java/JEE Ruby/Rails
  • 22. RailsConf 2006
    • Application Deployment: Capistrano
    • Enhanced Scaffolding (AJAX): Streamlined
    • Generalizing CRUD Beyond Models: ActiveResource
  • 23. Streamlined
    • “Scaffolding on Steroids”
      • Quickly generate an AJAX interface, deriving relations from ActiveRecord Model specifications
  • 24. ActiveResource
    • CRUD Operations can be applied to any resource, not just databases
      • "What if the whole world could be modeled under the constraints of CRUD?"
      • Extend CRUD to form basis of Resource-Oriented Architecture (objects that provide CRUD Services)
  • 25. Finding Out More
    • Ruby Language:
    • Ruby On Rails:
    • Pragmatic Programmers:
    • Martin Fowler:
    • DHH:
    • 37Signals:
    • Streamlined:
  • 26. Finding Out More
    • Other resources:
      • (Sourceforge for Ruby)
      • (Shopify, Typo)
  • 27. Finding Out More
    • Books (Pragmatic Programmers):
      • Programming Ruby (2 nd Edition) 0974514055
      • Agile Web Development on Rails (2 nd Edition) 097669400X
  • 28.