Docstoc

Ruby on Rails

Document Sample
Ruby on Rails Powered By Docstoc
					     Ruby on Rails

Web Development that Doesn’t
           Hurt




                Brattleboro Tech Collective
              Marlboro College Grad Center
                         February 18, 2006
Ruby on Rails: Web Development that Doesn’t Hurt




                    • Introduction

               • Demo Application

                           • Q&A
• Collectively owned and operated

• Web site development

• We specialize in Web applications
Brattleboro Tech Collective




  • Open Source Content Management System

  • Shopping Carts and Order Processing

  • Book Publishing Software

  • Class/Training Registration System
Evolution of Web Applications
         CGI

server-side applications
CGI and server-side applications




Escaped HTML is in the code:

   Difficult to organize, difficult to
   maintain.
     inline code
code is embedded into HTML


        Examples:
        • PHP
        • embedded Perl
        • JSP
        • ASP
        • ColdFusion
inline code




Difficult to separate display logic from
 application logic

Difficult to build large applications
separation of logic and
     presentation
Model, View, Controller (MVC)

  an architecture to separate logic
         from presentation



                          Used by Ruby on Rails

                    (also used by Java on Struts)
           Model

data, usually held in a database
            View

how things are presented to the
  user (HTML and CSS, user
          interface)
         Controller

code and business logic, controls
the interaction between the View
          and the Model
        Ruby
• programming language

• released in 1995 in Japan by
  Yukihiro Matsumoto
Ruby




  • Open Source

  • Highly object-oriented

  • Focuses on the needs of the programmer, not
    the needs of the machine

  • syntax: similar to Perl
Ruby syntax




def add_poodle
  @poodle = Poodle.new(params[:poodle])
  @poodle.owner = Owner.find(params[:id])
  @poodle.save
  render(:partial => 'poodle', :layout => false)
 end
        Rails
• open source web applications
  framework

• originally written to develop
  Basecamp

• released in 2004 by 37 Signals
Basecamp by 37 Signals
Tadalist and Backpack
 by 37 Signals
Typo
Odeo
43 Things
     Framework

• support structure in which other
  applications can be developed

• Rails is an MVC framework
Advantages of Rails




• Rails handles the tedious and routine structures so the
  programmer can focus on actual programming

• Scaffold: the initial Create/Read/Update/Delete system (CRUD)

• Automatic form validation

• Automatic setup for application testing
Rails integrates well with AJAX

• Asynchronous Javascript and XML

• AJAX is not a technology, it is a technique

• AJAX is a way to exchange data with the server
  without having to reload the entire web page
Case Study: Poodle Influenza
Your company has won a bid by the CDC (Center for Disease
Control and Prevention) and the AKC (American Kennel Club)
to help develop a poodle tracking application to help poodle
owners register their precious pets in a national database. The
data from this application will become part of the EDSRN
(Emergency Dog Show Relief Network.)

The application will be used to collect info over the web about
the owners and the individual poodles they own. Data from the
application will be used to determine poodle distributions
around the country and help computer simulations determine
likely outcomes of a poodle pandemic and to calculate the
possible economic repercussions on the dog show industry.
Case Study: Poodle Influenza




  • Data Structure: Poodles and Owners

  • Must CRUD (Create/Read/Update/Delete)

  • Focuses on the needs of the programmer, not
    the needs of the machine
(end of slideshow)


           Brattleboro Tech Collective
         Marlboro College Grad Center
                    February 18, 2006

				
DOCUMENT INFO
Shared By:
Categories:
Tags:
Stats:
views:5
posted:3/27/2012
language:
pages:30