0
Ruby & Ruby on Rails José de Leon K-LUG July 13, 2006
About Me <ul><li>José de Leon </li></ul><ul><ul><li>Career software developer, Problem-Solver by nature </li></ul></ul><ul...
About This Talk <ul><li>History of Ruby & Rails </li></ul><ul><li>About Ruby </li></ul><ul><li>About Software Best Practic...
History of Ruby on Rails <ul><li>History of Ruby </li></ul><ul><li>History of Rails </li></ul>
History of Ruby <ul><li>Created by Yukihiro “Matz” Matsumoto in Japan, 1995 </li></ul><ul><li>Inspired by Perl, LISP, and ...
History of Rails <ul><li>Conception of David Heinemeier-Hansson </li></ul><ul><li>Based on work derived from Basecamp, a w...
About Ruby <ul><li>Understanding Rails requires understanding Ruby </li></ul><ul><li>Ruby is a  multi-paradigm, interprete...
About Ruby <ul><li>Strong text-processing and regular-expression capabilities on a par with Perl </li></ul><ul><li>O-O/fun...
About Best Practices <ul><li>Best thing about Rails: Embodies and enforces best practices and strong principles in designi...
Frameworks Are Extractions <ul><li>Rails is based on a successful web-based application, Basecamp </li></ul><ul><li>Consis...
Active Record Pattern <ul><li>Maps rows in a database to objects in an application </li></ul><ul><li>Database fields are m...
Model-Controller-View <ul><li>Separation of: </li></ul><ul><ul><li>Data (Model) </li></ul></ul><ul><ul><li>Operations on D...
Test-Driven Development <ul><li>Rails encourages you to write your tests as you develop </li></ul><ul><ul><li>Create tests...
Other Best Practices <ul><li>Emphasize Simplicity: </li></ul><ul><ul><li>Principle Of Least-Surprise (POLS) AKA Law Of Lea...
How Rails Embodies Best Practices <ul><li>Demo: Simple contact list </li></ul><ul><ul><li>Strong application structure cre...
How Rails Embodies Best Practices <ul><li>Rails presents a ready-to-use MCV architecture: </li></ul><ul><ul><li>Model: Act...
Other Rails Features <ul><li>Rails supports sub-frameworks for: </li></ul><ul><ul><li>Testing </li></ul></ul><ul><ul><li>A...
Rails Applications <ul><li>RadiantCMS </li></ul><ul><li>Blogging Engines: </li></ul><ul><ul><li>Typo </li></ul></ul><ul><u...
Rails vs Other Frameworks <ul><li>Rails (and others) are a reflection of Agile Development techniques </li></ul><ul><ul><l...
Rails vs Other Frameworks <ul><li>TurboGears and Java frameworks: combinations of existing products/projects: </li></ul><u...
Demo <ul><li>Garage Invoicing Application </li></ul><ul><ul><li>Componentized approach </li></ul></ul><ul><ul><li>Techniqu...
RailsConf 2006 <ul><li>Application Deployment: Capistrano </li></ul><ul><li>Enhanced Scaffolding (AJAX): Streamlined </li>...
Streamlined <ul><li>“Scaffolding on Steroids” </li></ul><ul><ul><li>Quickly generate an AJAX interface, deriving relations...
ActiveResource <ul><li>CRUD Operations can be applied to any resource, not just databases </li></ul><ul><ul><li>&quot;What...
Finding Out More <ul><li>Ruby Language:  http://www.ruby-lang.org </li></ul><ul><li>Ruby On Rails:  http://www.rubyonrails...
Finding Out More <ul><li>Other resources: </li></ul><ul><ul><li>http://www.ruby-doc.org </li></ul></ul><ul><ul><li>http://...
Finding Out More <ul><li>Books (Pragmatic Programmers): </li></ul><ul><ul><li>Programming Ruby (2 nd  Edition) 0974514055 ...
 
Upcoming SlideShare
Loading in...5
×

Ruby On Rails - Rochester K Linux User Group

1,626

Published on

Presentation on Ruby On Rails web framework for the Rochester (Minnesota) "K" Linux User Group

Published in: Technology
0 Comments
2 Likes
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total Views
1,626
On Slideshare
0
From Embeds
0
Number of Embeds
3
Actions
Shares
0
Downloads
16
Comments
0
Likes
2
Embeds 0
No embeds

No notes for slide

Transcript of "Ruby On Rails - Rochester K Linux User Group"

  1. 1. Ruby & Ruby on Rails José de Leon K-LUG July 13, 2006
  2. 2. About Me <ul><li>José de Leon </li></ul><ul><ul><li>Career software developer, Problem-Solver by nature </li></ul></ul><ul><ul><ul><li>Obsessed with “Finding the best way or best approach” </li></ul></ul></ul><ul><ul><li>“ Good storyteller” </li></ul></ul><ul><ul><li>Interests: </li></ul></ul><ul><ul><ul><li>Object-oriented development </li></ul></ul></ul><ul><ul><ul><li>User-experience, including developers </li></ul></ul></ul><ul><ul><ul><li>Best practices - what's worked well for others </li></ul></ul></ul><ul><ul><ul><li>Outside: pro basketball/sports, comics </li></ul></ul></ul><ul><ul><li>Email: [email_address] </li></ul></ul>
  3. 3. About This Talk <ul><li>History of Ruby & Rails </li></ul><ul><li>About Ruby </li></ul><ul><li>About Software Best Practices </li></ul><ul><li>How Rails Embodies Best Practices </li></ul><ul><li>Demos </li></ul><ul><li>RailsConf 2006 </li></ul>
  4. 4. History of Ruby on Rails <ul><li>History of Ruby </li></ul><ul><li>History of Rails </li></ul>
  5. 5. History of Ruby <ul><li>Created by Yukihiro “Matz” Matsumoto in Japan, 1995 </li></ul><ul><li>Inspired by Perl, LISP, and Smalltalk </li></ul><ul><li>Gained popularity outside Japan around 2000, when Programming Ruby (1 st ed) was published by Thomas and Hunt </li></ul>
  6. 6. History of Rails <ul><li>Conception of David Heinemeier-Hansson </li></ul><ul><li>Based on work derived from Basecamp, a web-based project-management application </li></ul><ul><li>Extracted as a distinct framework, Summer 2004 </li></ul><ul><li>1.0 release in December 2005 </li></ul>“ Rails is a full-stack framework for developing database-backed web applications according to the Model-View-Control pattern.”
  7. 7. About Ruby <ul><li>Understanding Rails requires understanding Ruby </li></ul><ul><li>Ruby is a multi-paradigm, interpreted programming language : </li></ul><ul><ul><li>Imperative </li></ul></ul><ul><ul><li>Object-oriented </li></ul></ul><ul><ul><li>Functional </li></ul></ul><ul><li>Familiarity with Perl, Smalltalk, Java, LISP, C++ will be an asset </li></ul>
  8. 8. About Ruby <ul><li>Strong text-processing and regular-expression capabilities on a par with Perl </li></ul><ul><li>O-O/functional properties of Ruby allow you to write programs in as natural a language as spoken language </li></ul><ul><ul><li>Ruby programs tend to be readable </li></ul></ul><ul><ul><li>Ruby has strong collections facilities </li></ul></ul><ul><li>Ruby is a scripting-language </li></ul><ul><ul><li>Programs can be developed in an incremental, interactive style with fast turnaround </li></ul></ul>
  9. 9. About Best Practices <ul><li>Best thing about Rails: Embodies and enforces best practices and strong principles in designing software </li></ul>
  10. 10. Frameworks Are Extractions <ul><li>Rails is based on a successful web-based application, Basecamp </li></ul><ul><li>Consistently repeated motifs and patterns : extracted to create the basis for a framework </li></ul><ul><ul><li>Drawn from real-life usage and experience </li></ul></ul><ul><li>Opposes “Big Design Up-Front” (BDUF) approach to framework building </li></ul><ul><ul><li>BDUF often leads to many libraries that few find useful </li></ul></ul>
  11. 11. Active Record Pattern <ul><li>Maps rows in a database to objects in an application </li></ul><ul><li>Database fields are mapped to object attributes </li></ul><ul><li>Add “smart” operations for an object to interact with a database </li></ul><ul><ul><li>4 basic operations: </li></ul></ul><ul><ul><ul><li>CREATE (INSERT) </li></ul></ul></ul><ul><ul><ul><li>RETRIEVE (SELECT) </li></ul></ul></ul><ul><ul><ul><li>UPDATE (UPDATE) </li></ul></ul></ul><ul><ul><ul><li>DESTROY (DELETE) </li></ul></ul></ul>
  12. 12. Model-Controller-View <ul><li>Separation of: </li></ul><ul><ul><li>Data (Model) </li></ul></ul><ul><ul><li>Operations on Data (Controller): </li></ul></ul><ul><ul><ul><li>Data manipulation </li></ul></ul></ul><ul><ul><ul><li>Data presentation </li></ul></ul></ul><ul><ul><li>Presentation of Data (View) </li></ul></ul>
  13. 13. Test-Driven Development <ul><li>Rails encourages you to write your tests as you develop </li></ul><ul><ul><li>Create tests exercising one facet of your application: </li></ul></ul><ul><ul><ul><li>Unit Tests: Essential operations on a single model </li></ul></ul></ul><ul><ul><ul><li>Functional Tests: Essential operations between a controller and model </li></ul></ul></ul><ul><ul><ul><li>Integration Tests: Interactions between several controllers and models (referring to Use-Cases) </li></ul></ul></ul>
  14. 14. Other Best Practices <ul><li>Emphasize Simplicity: </li></ul><ul><ul><li>Principle Of Least-Surprise (POLS) AKA Law Of Least Astonishment (LOLA) </li></ul></ul><ul><ul><li>“Do the simplest thing that could possibly work” </li></ul></ul><ul><li>Enable Refactoring </li></ul><ul><li>Don't Repeat Yourself (DRY) </li></ul><ul><li>Convention Over Configuration </li></ul><ul><ul><li>Handle most common cases most easily, often by default </li></ul></ul>
  15. 15. How Rails Embodies Best Practices <ul><li>Demo: Simple contact list </li></ul><ul><ul><li>Strong application structure created for you </li></ul></ul><ul><li>Ruby code is used at every level of development in the Rails framework: </li></ul><ul><ul><li>DB creation and schema management (Migrations) </li></ul></ul><ul><ul><li>Build maintenance (Rake Tasks) </li></ul></ul><ul><ul><li>URL routing (Routes) </li></ul></ul><ul><ul><li>Content serving (Webrick, Mongrel) </li></ul></ul>
  16. 16. How Rails Embodies Best Practices <ul><li>Rails presents a ready-to-use MCV architecture: </li></ul><ul><ul><li>Model: ActiveRecord </li></ul></ul><ul><ul><li>Controller: ActionController </li></ul></ul><ul><ul><li>View: ActionView </li></ul></ul><ul><li>ActionController includes controller equivalents (user actions) for ActiveRecord CRUD operations </li></ul><ul><li>ActionView can generate output for different media thru Ruby code: </li></ul><ul><ul><li>RHTML: Plain text/html </li></ul></ul><ul><ul><li>RXML: XML, for Web Services (ActionWebService) </li></ul></ul><ul><ul><li>RJS: Javascript for AJAX </li></ul></ul>
  17. 17. Other Rails Features <ul><li>Rails supports sub-frameworks for: </li></ul><ul><ul><li>Testing </li></ul></ul><ul><ul><li>AJAX (several popular Javascript libraries are included) </li></ul></ul><ul><ul><li>Web services </li></ul></ul><ul><ul><li>Email (ActionMailer) </li></ul></ul>
  18. 18. Rails Applications <ul><li>RadiantCMS </li></ul><ul><li>Blogging Engines: </li></ul><ul><ul><li>Typo </li></ul></ul><ul><ul><li>Instiki (Wiki engine) </li></ul></ul><ul><li>E-Commerce Tools: </li></ul><ul><ul><li>RightCart (embedded shopping cart) </li></ul></ul><ul><ul><li>Shopify (hosted on-line stores) </li></ul></ul>
  19. 19. Rails vs Other Frameworks <ul><li>Rails (and others) are a reflection of Agile Development techniques </li></ul><ul><ul><li>Favored over bloated “Enterprise” solutions (JEE) </li></ul></ul><ul><ul><li>Covers “sweet spot” of web applications: web front-ends for a database </li></ul></ul><ul><li>Rails competes with other frameworks: </li></ul><ul><ul><li>Python: Django, TurboGears </li></ul></ul><ul><ul><li>Java: JEE stack, HSE, Trails, Grails </li></ul></ul><ul><ul><li>PHP, .NET </li></ul></ul>
  20. 20. Rails vs Other Frameworks <ul><li>TurboGears and Java frameworks: combinations of existing products/projects: </li></ul><ul><ul><li>SQLObject (model) CherryPy (view/controller) for TurboGears </li></ul></ul><ul><ul><li>Mix of Hibernate/iBatis/Spring (model/controller) Tapestry/Echo2/Spring MVC (view) etc. for Java/JEE </li></ul></ul><ul><li>Django very close in philosophy of design with Rails </li></ul><ul><li>Agile techniques and practices worked into other technology stacks (.NET) </li></ul><ul><li>Ruby as a language has a lot going for it </li></ul>
  21. 21. Demo <ul><li>Garage Invoicing Application </li></ul><ul><ul><li>Componentized approach </li></ul></ul><ul><ul><li>Techniques for chaining views and models </li></ul></ul><ul><ul><li>A little AJAX </li></ul></ul><ul><ul><li>Productivity gains, especially over Java </li></ul></ul>C/C++ Java/JEE Ruby/Rails
  22. 22. RailsConf 2006 <ul><li>Application Deployment: Capistrano </li></ul><ul><li>Enhanced Scaffolding (AJAX): Streamlined </li></ul><ul><li>Generalizing CRUD Beyond Models: ActiveResource </li></ul>
  23. 23. Streamlined <ul><li>“Scaffolding on Steroids” </li></ul><ul><ul><li>Quickly generate an AJAX interface, deriving relations from ActiveRecord Model specifications </li></ul></ul>
  24. 24. ActiveResource <ul><li>CRUD Operations can be applied to any resource, not just databases </li></ul><ul><ul><li>&quot;What if the whole world could be modeled under the constraints of CRUD?&quot; </li></ul></ul><ul><ul><li>Extend CRUD to form basis of Resource-Oriented Architecture (objects that provide CRUD Services) </li></ul></ul>
  25. 25. Finding Out More <ul><li>Ruby Language: http://www.ruby-lang.org </li></ul><ul><li>Ruby On Rails: http://www.rubyonrails.org </li></ul><ul><li>Pragmatic Programmers: http://www.pragmaticprogrammer.com </li></ul><ul><li>Martin Fowler: http://www.martinfowler.com </li></ul><ul><li>DHH: http://www.loudthinking.com </li></ul><ul><li>37Signals: http://www.37signals.com </li></ul><ul><li>Streamlined: http://streamlined.relevancellc.com </li></ul>
  26. 26. Finding Out More <ul><li>Other resources: </li></ul><ul><ul><li>http://www.ruby-doc.org </li></ul></ul><ul><ul><li>http://www.rubyforge.org (Sourceforge for Ruby) </li></ul></ul><ul><ul><li>http://www.rubyinside.com </li></ul></ul><ul><ul><li>http://www.radiantcms.org </li></ul></ul><ul><ul><li>http://www.jadedpixel.com (Shopify, Typo) </li></ul></ul>
  27. 27. Finding Out More <ul><li>Books (Pragmatic Programmers): </li></ul><ul><ul><li>Programming Ruby (2 nd Edition) 0974514055 </li></ul></ul><ul><ul><li>Agile Web Development on Rails (2 nd Edition) 097669400X </li></ul></ul>
  1. A particular slide catching your eye?

    Clipping is a handy way to collect important slides you want to go back to later.

×