130 likes | 246 Vues
Ruby on Rails Tutorial. Peter Mosca April, 2007. Ruby History. Invented 12 years ago in Japan by Yukihiro Matsumoto Spent first 5 years in Japan Experienced tremendous growth in international community since 2000. What is Ruby?.
E N D
Ruby on Rails Tutorial Peter Mosca April, 2007
Ruby on Rails Tutorial Ruby History • Invented 12 years ago in Japan by Yukihiro Matsumoto • 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 • Well-established and robust
Ruby on Rails Tutorial Ruby on Rails History • Developed by David Heinemeier Hansson in 2004 • 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 applications” • Dave Thomas, author of The Pragmatic Programmer
Ruby on Rails Tutorial Ruby on Rails • Rails is framework, written in Ruby, for developing database-backed web applications • Open Source • “Full-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 workflow • 3 Separate Databases • Development • Test • Production
Ruby on Rails Tutorial Active Record • “Database Wrapping” instead of “Database Mapping” • Each active record object represents a row in a table • Each record object has CRUD methods for database access
Ruby on Rails Tutorial 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 Active Record
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