Ruby On Rails Presentation

75 %
25 %
Information about Ruby On Rails Presentation

Published on May 10, 2008

Author: pageman

Source: slideshare.net

Description

Ruby on Rails intro by David Quitoriano

Ruby on Rails Optimized for programmer happiness and sustainable productivity Based on Curt Hibbs' Rails presentation to the St. Louis Java Users Group (June 2006) http://dave.quitoriano.org/csb

Overview What is Ruby? What is Rails? MVC (Model-View-Controller) Live Demonstration (sort of…) Agile vs. Waterfall Model Rails Applications in Production Q&A Resources

What is Ruby?

What is Rails?

MVC (Model-View-Controller)

Live Demonstration (sort of…)

Agile vs. Waterfall Model

Rails Applications in Production

Q&A

Resources

What is Ruby? A dynamic, object-oriented programming language with: a strong focus on simplicity and productivity Smalltalk's conceptual elegance, Python's ease of use and learning, and Perl's pragmatism. Ruby originated in Japan during the mid-1990s and was initially developed and designed by Yukihiro "Matz" Matsumoto.

A dynamic, object-oriented programming language with:

a strong focus on simplicity and productivity

Smalltalk's conceptual elegance,

Python's ease of use and learning, and

Perl's pragmatism.

Ruby originated in Japan during the mid-1990s and was initially developed and designed by Yukihiro "Matz" Matsumoto.

Ruby is... Interpreted Like Perl, Python Object-Oriented Like Smalltalk, Eiffel, Ada, Java Rapidly Gaining Mindshare in US and Europe Originated in Japan, very popular there

Interpreted

Like Perl, Python

Object-Oriented

Like Smalltalk, Eiffel, Ada, Java

Rapidly Gaining Mindshare in US and Europe

Originated in Japan, very popular there

Why Ruby? Easy to learn Open source (very liberal license) Rich libraries Very easy to extend Truly Object-Oriented Excellent community Bottom Line: write more understandable code in fewer lines Less code means fewer bugs

Easy to learn

Open source (very liberal license)

Rich libraries

Very easy to extend

Truly Object-Oriented

Excellent community

Bottom Line: write more understandable code in fewer lines

Less code means fewer bugs

Sample Ruby Code Code courtesy of John W. Long

Sample Ruby Code Code courtesy of John W. Long

What is Rails? “ Rails is a full-stack framework for developing database-backed web applications according to the Model-View-Control pattern.” www.rubyonrails.org - Ruby on Rails official site

“ Rails is a full-stack framework for developing database-backed web applications according to the Model-View-Control pattern.”

www.rubyonrails.org - Ruby on Rails official site

Rails is a Full-Stack Framework Includes everything needed to create a database-driven web application using the Model-View-Controller pattern. Being a full-stack framework means that all layers are built to work seamlessly together. That way you Don’t Repeat Yourself (DRY).

Includes everything needed to create a database-driven web application using the Model-View-Controller pattern.

Being a full-stack framework means that all layers are built to work seamlessly together.

That way you Don’t Repeat Yourself (DRY).

Rails is Agile built-in webserver generators – save the fingers (CRUD) scaffold – kick-off start plugins, libraries, tons of contributed code native AJAX support “ leaving you to fill in the applications logic”

built-in webserver

generators – save the fingers (CRUD)

scaffold – kick-off start

plugins, libraries, tons of contributed code

native AJAX support

“ leaving you to fill in the applications logic”

DHH David Heinemeier Hansson (28) is a Danish programmer and the creator of the popular Ruby on Rails web development framework. He is also a partner at the web-based software development firm 37signals. In 2005 he was recognized by Google and O'Reilly with the Hacker of the Year award for his creation of Ruby on Rails. Last July 2006, Business 2.0 ranked him 34th among '50 people who matter now'. Source: Wikipedia (http://en.wikipedia.org/wiki/David_Heinemeier_Hansson)

David Heinemeier Hansson (28) is a Danish programmer and the creator of the popular Ruby on Rails web development framework. He is also a partner at the web-based software development firm 37signals.

In 2005 he was recognized by Google and O'Reilly with the Hacker of the Year award for his creation of Ruby on Rails.

Last July 2006, Business 2.0 ranked him 34th among '50 people who matter now'.

Source: Wikipedia (http://en.wikipedia.org/wiki/David_Heinemeier_Hansson)

Principles of Ruby Japanese Design Aesthetics Shine Through Focus on human factors Principle of Least Surprise Principle of Succinctness Relevant because these principles were followed closely by the designer of Rails, David H. Hansson Scandinavian Design Aesthetic

Japanese Design Aesthetics Shine Through

Focus on human factors

Principle of Least Surprise

Principle of Succinctness

Relevant because these principles were followed closely by the designer of Rails, David H. Hansson

Scandinavian Design Aesthetic

Philosophies Less Code Requires fewer total lines of code than other frameworks spend setting up their XML configuration files. Convention over Configuration Rails shuns configuration files in favor of conventions, reflection and dynamic run-time extensions. Configure your application by making it Your code and database schema are the configuration! No compilation phase Make a change, see it work.

Less Code

Requires fewer total lines of code than other frameworks spend setting up their XML configuration files.

Convention over Configuration

Rails shuns configuration files in favor of conventions, reflection and dynamic run-time extensions.

Configure your application by making it

Your code and database schema are the configuration!

No compilation phase

Make a change, see it work.

Traditional Applications Browser directly accesses page. Does not centralize control No content/style separation Easy and fast to produce Difficult to maintain

Browser directly accesses page.

Does not centralize control

No content/style separation

Easy and fast to produce

Difficult to maintain

MVC Applications Browser accesses a “controller” Centralizes control Clean separation of content/style More involved to produce Easier to maintain and expand

Browser accesses a “controller”

Centralizes control

Clean separation of content/style

More involved to produce

Easier to maintain and expand

Design Pattern A pattern that has been developed to help programmers cope with common problems. Blueprints on how to construct something.

A pattern that has been developed to help programmers cope with common problems.

Blueprints on how to construct something.

Typical Bakery Interaction Request a tasty treat from the baker http://www.pixpatisserie.com/

Request a tasty treat from the baker

Baker responds with your treat http://www.pixpatisserie.com/

Bakery Flow

MVC Diagram

All Together Now http://wiki.rubyonrails.org/

Rails and MVC Model (ActiveRecord) Maintains the relationship between Object and Database Handles validation, association, transations, and more… Does not completely insulate the developer from SQL

Model (ActiveRecord)

Maintains the relationship between Object and Database

Handles validation, association, transations, and more…

Does not completely insulate the developer from SQL

Rails and MVC View (ActionView) Script-based templating system (like JSP, ASP, PHP, etc.) Tight controller integration Reusable components Integrated, easy to use Ajax support.

View (ActionView)

Script-based templating system (like JSP, ASP, PHP, etc.)

Tight controller integration

Reusable components

Integrated, easy to use Ajax support.

Rails and MVC Controller (ActionController) Reflection ties actions to methods Tight view integration Filters, layouts, caching, sessions, etc.

Controller (ActionController)

Reflection ties actions to methods

Tight view integration

Filters, layouts, caching, sessions, etc.

Rails Demonstration

Testing Rails Rails has great testing framework ‘baked in’ the framework Test stubs created when code is ‘generated’. Unit to test models. test/unit Functional to test views/controllers test/functional Fixtures Supply test data (yaml)

Rails has great testing framework ‘baked in’ the framework

Test stubs created when code is ‘generated’.

Unit to test models.

test/unit

Functional to test views/controllers

test/functional

Fixtures

Supply test data (yaml)

Unit Testing Separate ‘test’ database is used. Fixtures supply data Variety of ‘assert’ statements. http://rspec.info/

Separate ‘test’ database is used.

Fixtures supply data

Variety of ‘assert’ statements.

Database Support Supported Databases MySQL PostgreSQL SQLite SQL Server Coming Soon Oracle DB2 Firebird more…

Supported Databases

MySQL

PostgreSQL

SQLite

SQL Server

Coming Soon

Oracle

DB2

Firebird

more…

Server Configurations WEBrick Built-in to Rails Good development environment Apache/CGI Easy to set up, but slow Apache/mod_ruby Ruby interpreter per Apache process Apache/mod_fastcgi Pool of Ruby processes Lighttpd Built-in fastcgi support Small footprint, high performance

WEBrick

Built-in to Rails

Good development environment

Apache/CGI

Easy to set up, but slow

Apache/mod_ruby

Ruby interpreter per Apache process

Apache/mod_fastcgi

Pool of Ruby processes

Lighttpd

Built-in fastcgi support

Small footprint, high performance

Waterfall Model

 

Agile Programming

 

Agile Manifesto We are uncovering better ways of developing software by doing it and helping others do it. Through this work we have come to value: Individuals and interactions over processes and tools Working software over comprehensive documentation Customer collaboration over contract negotiation Responding to change over following a plan

We are uncovering better ways of developing software by doing it and helping others do it. Through this work we have come to value:

Individuals and interactions over processes and tools

Working software over comprehensive documentation

Customer collaboration over contract negotiation

Responding to change over following a plan

Get something real up and running quickly Running software is the best way to build momentum, rally your team, and flush out ideas that don't work. It should be your number one priority from day one. It's ok to do less, skip details, and take shortcuts in your process if it'll lead to running software faster. Once you're there, you'll be rewarded with a significantly more accurate perspective on how to proceed. Stories, wireframes, even html mockups, are just approximations. Running software is real. With real, running software everyone gets closer to true understanding and agreement. You avoid heated arguments over sketches and paragraphs that wind up turning out not to matter anyway. You realize that parts you thought were trivial are actually quite crucial. http://gettingreal.37signals.com/ (IM Students required reading)

Get something real up and running quickly

Running software is the best way to build momentum, rally your team, and flush out ideas that don't work. It should be your number one priority from day one.

It's ok to do less, skip details, and take shortcuts in your process if it'll lead to running software faster. Once you're there, you'll be rewarded with a significantly more accurate perspective on how to proceed. Stories, wireframes, even html mockups, are just approximations. Running software is real.

With real, running software everyone gets closer to true understanding and agreement. You avoid heated arguments over sketches and paragraphs that wind up turning out not to matter anyway. You realize that parts you thought were trivial are actually quite crucial.

http://gettingreal.37signals.com/ (IM Students required reading)

Development Metrics Basecamp Launched in early 2004 “ Tens of thousands of users across 50 countries” 2 man-months of programming by a single developer (the Rails author). 4,000 Lines of Code. Server details One dual 2.2GHz Xeon, 2G RAM.

Basecamp

Launched in early 2004

“ Tens of thousands of users across 50 countries”

2 man-months of programming by a single developer (the Rails author).

4,000 Lines of Code.

Server details

One dual 2.2GHz Xeon, 2G RAM.

Development Metrics Backpack Launched in May 2005 http://www.backpackit.com Makes very heavy use of Rails’ built-in Ajax support for an extremely responsive user interface.

Backpack

Launched in May 2005

http://www.backpackit.com

Makes very heavy use of Rails’ built-in Ajax support for an extremely responsive user interface.

Development Metrics 43 Things “ With Ruby and Rails we went from nothing to a live site in about 3 months . Only one person in the company had any prior Ruby experience (me) and he spent half his time playing sysadmin. “ In the 2.5 months since launch we’ve done major rewrites of two of our core codepaths, added 3 large features and have done exploratory programming in two other directions with only 5 developers . “ Our codebase is hanging in at just under 7,000 lines of production Ruby…” As of February, 2005: 9,000 registered users 200,000 hits per day

43 Things

“ With Ruby and Rails we went from nothing to a live site in about 3 months . Only one person in the company had any prior Ruby experience (me) and he spent half his time playing sysadmin.

“ In the 2.5 months since launch we’ve done major rewrites of two of our core codepaths, added 3 large features and have done exploratory programming in two other directions with only 5 developers .

“ Our codebase is hanging in at just under 7,000 lines of production Ruby…”

As of February, 2005:

9,000 registered users

200,000 hits per day

Development Metrics BellyButton.de Launched in February 2005 An ecommerce site marketing pregnancy related products. 2 developers and one graphic designer. 2,400 Lines of Code. 5 man-months of development time.

BellyButton.de

Launched in February 2005

An ecommerce site marketing pregnancy related products.

2 developers and one graphic designer.

2,400 Lines of Code.

5 man-months of development time.

Development Metrics SnowDevil.ca Launched in February 2005 An ecommerce site marketing snowboards and related gear. 2 developers . 6,000 lines of code. 4 months of development time.

SnowDevil.ca

Launched in February 2005

An ecommerce site marketing snowboards and related gear.

2 developers .

6,000 lines of code.

4 months of development time.

Development Metrics StoryCards Web app to support XP-style development by Jim Weirich http:// onestepback .org:3030/ 1,250 Lines of code 8 hours of development time

StoryCards

Web app to support XP-style development by Jim Weirich

http:// onestepback .org:3030/

1,250 Lines of code

8 hours of development time

Rails Testimonials “ Rails is the most well thought-out web development framework I've ever used. And that's in a decade of doing web applications for a living. I've built my own frameworks, helped develop the Servlet API, and have created more than a few web servers from scratch. Nobody has done it like this before. That's not to say they got it all right. It's by no means "perfect". I've got more than a few nits and picks about how things are put together. But "perfect" isn't the point. The point is that it gets you up and going fast and has plenty of depth to keep you going. And Rails does that very well.” - James Duncan Davidson was the creator of Apache Tomcat and Apache Ant and was instrumental in their donation to the Apache Software Foundation by Sun Microsystems . While working at Sun, he authored two versions of the Java Servlet API specification as well as the Java API for XML Processing.

“ Rails is the most well thought-out web development framework I've ever used. And that's in a decade of doing web applications for a living. I've built my own frameworks, helped develop the Servlet API, and have created more than a few web servers from scratch. Nobody has done it like this before. That's not to say they got it all right. It's by no means "perfect". I've got more than a few nits and picks about how things are put together. But "perfect" isn't the point. The point is that it gets you up and going fast and has plenty of depth to keep you going. And Rails does that very well.”

- James Duncan Davidson was the creator of Apache Tomcat and Apache Ant and was instrumental in their donation to the Apache Software Foundation by Sun Microsystems . While working at Sun, he authored two versions of the Java Servlet API specification as well as the Java API for XML Processing.

“ I can only show you the door. You're the one that has to walk through it.” - Morpheus, The Matrix, 1999

In closing It's not the language. It's the programming principle. Simply put, “It's not the HOW, it's the WHY.” Commitment to open source technologies (Java/Ruby/Phython) Encourage a “Framework” mindset Emphasis on application testing Creators vs Followers Innovators vs the Wait-and-see Bleeding edge vs software that suck

It's not the language. It's the programming principle. Simply put, “It's not the HOW, it's the WHY.”

Commitment to open source technologies (Java/Ruby/Phython)

Encourage a “Framework” mindset

Emphasis on application testing

Creators vs Followers

Innovators vs the Wait-and-see

Bleeding edge vs software that suck

Resources Ruby Main Ruby Site http://www.ruby-lang.org/en/ One-Click Ruby Installer for Windows http:// rubyinstaller . rubyforge .org/ RubyForge – open source project repository http:// rubyforge .org/ Rails Main Rails Site http://www. rubyonrails .org/ Rails Tutorial (2 part series) http://www.onlamp.com/pub/a/onlamp/2005/01/20/rails.html http://www.onlamp.com/pub/a/onlamp/2005/03/03/rails.html Agile Web Development with Rails (first Rails book) http://www.pragmaticprogrammer.com/titles/rails/ Ajax on Rails http://www. onlamp .com/

Ruby

Main Ruby Site

http://www.ruby-lang.org/en/

One-Click Ruby Installer for Windows

http:// rubyinstaller . rubyforge .org/

RubyForge – open source project repository

http:// rubyforge .org/

Rails

Main Rails Site

http://www. rubyonrails .org/

Rails Tutorial (2 part series)

http://www.onlamp.com/pub/a/onlamp/2005/01/20/rails.html

http://www.onlamp.com/pub/a/onlamp/2005/03/03/rails.html

Agile Web Development with Rails (first Rails book)

http://www.pragmaticprogrammer.com/titles/rails/

Ajax on Rails

http://www. onlamp .com/

Add a comment

Related presentations

Related pages

RUBY ON RAILS PowerPoint PPT Presentations

View Ruby On Rails presentations online, safely and virus-free! Many are downloadable. Learn new and interesting things. Get ideas for your own presentations.
Read more

Ruby on Rails

RoR - Rails - Ruby on Rails sehr schlankes, quelloffenes Web-Framework Aufbau ist konsequent auf zeitsparende Entwicklung von datenbankgestützten ...
Read more

PPT – Ruby on Rails PowerPoint presentation | free to ...

The presentation will start after a short (15 second) video ad from one of our sponsors. Hot tip: Video ads won’t appear to registered users who are ...
Read more

20 Minute Presentation on Rails - Need to Impress - Ruby Forum

I have a 20 minute presentation coming up Tuesday for which I am giving an overview of Rails to an audience of other developers. What topics should I cover ...
Read more

ruby on rails - Techniques for setting up a web ...

Techniques for setting up a web application's presentation layer. ... I am working on a Ruby on Rails web application, ... Presentation, Service and DAO ...
Read more

Ruby on Rails

Ruby on Rails is open source software, so not only is it free to use, you can also help make it better. More than 4,200 people already have contributed ...
Read more