Ruby on Rails

cabbagepatchtapeInternet και Εφαρμογές Web

5 Φεβ 2013 (πριν από 5 χρόνια και 5 μήνες)

120 εμφανίσεις

Ruby on Rails Tutorial

Peter Mosca

April, 2007

Ruby on Rails Tutorial

Ruby History

Invented 12 years ago in Japan by Yukihiro

Spent first 5 years in Japan

Experienced tremendous growth in
international community since 2000

Ruby on Rails Tutorial

What is Ruby?

Ruby is a
dynamically typed

OO scripting
language similar to Perl and Python

Simple syntax

Principal of Least Surprise (POL)

Advanced language features

Scales better than most languages

established and robust

Ruby on Rails Tutorial

Ruby on Rails History

Developed by David Heinemeier Hansson in

Extracted from the Basecamp project

Ruby on Rails Tutorial

Ruby on Rails

“Ruby on Rails is a framework that makes it
easier to develop, deploy, and maintain web

Dave Thomas, author of
The Pragmatic

Ruby on Rails Tutorial

Ruby on Rails

Rails is framework, written in Ruby, for
developing database
backed web

Open Source

Stack” framework

Ruby on Rails Tutorial

Opinionated Software

Trade flexibility at the infrastructure level to
gain flexibility at the application level

Designed for the 98% solution, not the 99.9%

Push best practices at no extra cost

Quick, but not dirty

Ruby on Rails Tutorial

Rails is Opinionated

Convention over Configuration

DRY principal

Generate boilerplate code

Get it working quickly, then evolve it

Rails makes “best practices” assumptions

MVC pattern, Unit tests, 3 databases

Ruby on Rails Tutorial

Rails is Opinionated

MVC: Model View Controller pattern

Decouples the domain, presentation, and

3 Separate Databases




Ruby on Rails Tutorial

Active Record

“Database Wrapping” instead of “Database

Each active record object represents a row in
a table

Each record object has CRUD methods for
database access

Ruby on Rails Tutorial

Active Record

Adds attributes automatically, based on the
columns in the database

Adds relational management through a
custom internal language

Naming convention allow database to discover
specific fields

Schema migration “baked in” Rails

Ruby on Rails Tutorial

What’s Driving Rails Use?

Rails is fun

Rails is powerful

Rails development is fast!

Ruby on Rails Tutorial

Rails vs J2EE