getting on board ruby on rails n.
Download
Skip this Video
Loading SlideShow in 5 Seconds..
Getting On Board Ruby on Rails PowerPoint Presentation
Download Presentation
Getting On Board Ruby on Rails

Loading in 2 Seconds...

play fullscreen
1 / 40

Getting On Board Ruby on Rails - PowerPoint PPT Presentation


  • 138 Views
  • Uploaded on

Getting On Board Ruby on Rails. Brian Hogan and Lillian Hillis University of Wisconsin – Eau Claire. Getting On Board Ruby On Rails. What's the buzz. Framework is two years old New way to develop web-based applications Lots of converts from other languages. Getting On Board Ruby On Rails.

loader
I am the owner, or an agent authorized to act on behalf of the owner, of the copyrighted work described.
capcha
Download Presentation

PowerPoint Slideshow about 'Getting On Board Ruby on Rails' - rowdy


An Image/Link below is provided (as is) to download presentation

Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.


- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -
Presentation Transcript
getting on board ruby on rails
Getting On Board Ruby on Rails

Brian Hogan and Lillian Hillis

University of Wisconsin – Eau Claire

getting on board ruby on rails1

Getting On Board Ruby On Rails

What's the buzz

Framework is two years old

New way to develop web-based applications

Lots of converts from other languages

getting on board ruby on rails2

Getting On Board Ruby On Rails

When to use Rails

New web-to-database systems

Migrations from existing PHP, ASP, or Perl systems

An alternative to non-Enterprise J2EE systems

Systems in that gap between simple scripts and complex enterprise systems

getting on board ruby on rails3

Getting On Board Ruby On Rails

When NOT to use Rails

Simple scripts

Non-web projects

Complex systems with legacy databases

Possible to do but you will lose productivity gains

getting on board ruby on rails4

Getting On Board Ruby On Rails

How UW-Eau Claire Uses It

Web-based administrative systems for administrative and academic offices

Housing and Residence Life

Student Health Services

Music and Theater Arts

Continuing Education

Developed by student developers

New developers every couple of years

Team-based approach whenever possible

getting on board ruby on rails5

Getting On Board Ruby On Rails

Key Benefits

Rapid prototyping

Built-in testing

Easy to maintain and upgrade

Friendly user community

Easy to learn, embrace and extend

It’s agile!

getting on board ruby on rails6

Getting On Board Ruby On Rails

Who’s Using Rails

  • Penny Arcade
  • AListApart
  • Gusto
  • Shopify
  • Strongspace
  • Yakima-Herald Telegram
  • Subtopic
getting on board ruby on rails7

Getting On Board Ruby On Rails

Rails and the MVC Pattern

  • Model - View - Controller
  • Rails follows this pattern very strictly
  • Rails adds some extra components to this pattern
getting on board ruby on rails8

Getting On Board Ruby On Rails

Models

  • Provide access to database tables
  • Contain business rules
    • Record CRUD (Create, Read, Update, Delete)
  • An instance represents a row in a table
    • Grade model instance => one row from ‘grades’ table
model
Model
  • Models also define validations and associations with other models.
getting on board ruby on rails9

Getting On Board Ruby On Rails

Models

Provided by mboffin.com

getting on board ruby on rails10

Getting On Board Ruby On Rails

Controllers

  • Handle user requests
  • Retrieve data from models
  • Invoke methods on models
  • Send views and responses to users
  • Should contain no business logic
    • Only flow control
controllers
Controllers
  • Here’s a basic controller action to display a blog post
  • The URL would be /blog/show/1
getting on board ruby on rails11

Getting On Board Ruby On Rails

Views

  • The user screens or web pages of your applications
  • Should contain no business logic
  • Should not know about models
  • Should contain very little presentation logic whenever possible
    • Helpers are used for this
slide18
View
  • Views are similar to PHP or ASP pages
  • Much more powerful
  • Partials can be used to make our work easier
getting on board ruby on rails12

Getting On Board Ruby On Rails

Rails-specific MVC components

  • Helpers
  • Partials
  • Layouts
getting on board ruby on rails13

Getting On Board Ruby On Rails

Helpers

  • Place to put presentation logic
  • Available to Views and controllers
  • Rails has hundreds of built-in helpers for your views
  • Easy to make your own
getting on board ruby on rails14

Getting On Board Ruby On Rails

Partials

  • Pieces of view code that can be reused
    • Can be applied to a collection of data!
  • Designed to be shared across multiple views
  • Examples
    • Form fields for Create and Update pages
    • Search results
    • Tables
    • Table rows
getting on board ruby on rails15

Getting On Board Ruby On Rails

Layouts

  • Your templates are here.
  • Global or controller-specific
  • No need for header and footer separation
    • Rails reads the template last and places your application within the content region
  • Easy for designers to create layouts without knowing Rails
layouts
Layouts

Your rendered view is inserted here!

getting on board ruby on rails16

Getting On Board Ruby On Rails

Migrations

  • Database-independent schema definition
  • Incrementally define your database
  • Makes creation and recreation easy!

I’m platform-independent!

getting on board ruby on rails17

Getting On Board Ruby On Rails

Scaffolding

  • Generation of controllers and views based on model definition
  • Not meant for production use!
    • Needs tweaking first
getting on board ruby on rails19

Getting On Board Ruby On Rails

Scalability

  • Rails scales horizontally
  • When load is too high, bring up another instance of the app & load balance your traffic
  • Simple solutions for load-balancing
    • Apache 2.2 + mod_proxy_balance
    • Pound
    • Pen (Easy but no SSL support)
    • Lighttpd + mod_proxy
getting on board ruby on rails20

Getting On Board Ruby On Rails

Scalability (continued)

  • Know your current requirements
  • “100 users at the same time” isn’t a good benchmark
    • Simultaneous actions don’t happen all the time
  • Think “requests per second”
    • Measure your existing apps and see how Rails compares.
  • Your database is often the first scalability problem you’ll encounter in any web application
    • Databases can be clustered
getting on board ruby on rails21

Getting On Board Ruby On Rails

Performance

  • Rails performs on par with other languages
  • Slower on Windows
    • Limitation of compiled Ruby on Windows
  • My tests on similar hardware
    • 7 req/sec to 35 req/sec on Windows
    • 30 req/second to 150 req/second on Linux
  • Increase load by adding more “dispatchers” and load-balancing them
getting on board ruby on rails22

Getting On Board Ruby On Rails

Deployment

  • Linux is the best for deployment
  • Windows is supported
    • IIS won’t work well, if at all
    • Simple workarounds for this exist
  • Shared Hosting providers supporting Rails
    • Dreamhost (Great for personal stuff)
    • BlueHost
    • RailsPlayground
  • High-availability providers
    • RailsMachine
    • EngineYard
getting on board ruby on rails23

Getting On Board Ruby On Rails

Security

  • Security is a people problem
    • Developers must ensure security of their code and data
    • System admins must keep their systems up to date
  • Rails has built-in mechanisms for preventing SQL injection and XSS
  • Rails is as secure as any other server-side language
  • How secure is your platform underneath the web application?
choosing a development language
Choosing a Development Language
  • MyDecisionHelper
    • Helps you make critical decision using a patent-pending decision engine
    • Rails application developed by a team of five
      • Two Rails programmers, one designer, one consultant, and one market analyst, each working less than 20 hours per week
      • Developers are new to Rails
      • One developer made more progress in one weekend than in 3 months with .Net!
      • What you see didn’t exist 2 months ago!
getting on board ruby on rails24

Getting On Board Ruby On Rails

Resources - Books

  • Learn to Program (Chris Pine)
  • Agile Web Development with Rails (Dave Thomas and David Heinemeier Hansson)
  • Ruby for Rails, Ruby techniques for Rails developers (David Black)
  • Programming Ruby (Dave Thomas)
  • Rails Recipes (Chad Fowler)
getting on board ruby on rails25

Getting On Board Ruby On Rails

Resources – Web Sites

  • www.rubyonrails.org
  • wiki.rubyonrails.com
  • api.rubyonrails.org
  • www.uwec.edu/webdev/ror for additional resources
getting on board ruby on rails26

Getting On Board Ruby On Rails

Resources – Mailing List

  • groups.google.com/group/rubyonrails-talk
getting on board ruby on rails27

Getting On Board Ruby On Rails

Resources - Other

  • #rubyonrails on irc.freenode.org
  • Email Brian any time
    • hoganbp@uwec.edu
    • bphogan@gmail.com
  • Contact Brian any time after the presentation
getting on board ruby on rails29
Getting On Board Ruby on Rails

Brian Hogan

hoganbp@uwec.edu

Lillian Hillis

hillislf@uwec.edu