1 / 54

Introduction to Ruby on Rails TM

Introduction to Ruby on Rails TM. Sergio Ontiveros / Omar Ontiveros Solutionwise Consulting. March, 2009. About Solutionwise. Rails Application Development Rails Development / Consultancy serving both Large Organizations and SME’s Rails Platform Integration (Rails on Java infrastructure)

kyle-frye
Download Presentation

Introduction to Ruby on Rails TM

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Introduction toRuby on RailsTM Sergio Ontiveros / Omar Ontiveros Solutionwise Consulting March, 2009

  2. About Solutionwise • Rails Application Development • Rails Development / Consultancy serving both Large Organizations and SME’s • Rails Platform Integration (Rails on Java infrastructure) • Application Migration to Rails • Web Development Background • Java Platform • Web Applications • Client/Server Applications • .NET (C#, ASP.NET) • Lotus Domino • “Software Artisans” • Involved with Rails / Ruby since 2005 • Presentation Slides  www.solutionwise.ca

  3. Audience YOU

  4. Summary • Why Rails • What is Rails • How does it works • Where (How-does it works, part#2) • Ruby Demo • Rails Demo • Q & A

  5. WHY

  6. Why RoR? Why do I (you) need to know about it?

  7. But why is everyone talking about?, what does it fix?

  8. Its actually not quite true….

  9. In search of “Programmer Happiness”

  10. Complex?

  11. Toolbar Syndrome What about Tools for “Sophisticated Users” (a.k.a. Developers?)

  12. “Software Renaissance” “As a cultural movement, it encompassed a revival of learning based on classical sources, the development of linear perspective in painting, and gradual but widespread educational reform. Traditionally, this intellectual transformation has resulted in the Renaissance being viewed as a bridge between the Middle Ages and the Modern era.” Source: http://en.wikipedia.org/wiki/Renaissance

  13. Competitive Advantage • Constant change = Perpetual Renewal of Best Practices • Conveys practical software paradigms • Leverage from developer produced tools • Potentially it opens new business opportunities • Lower cost (Open Source)

  14. Fundamental Programming Principles • KISS principle • Automate repetitive tasks • Don’t over engineer solutions • Write less code = Less to maintain + Faster Code • Simple may lead to elegant • Raising levels of abstraction

  15. Your People Matters • What keeps Developers motivated • Use new technology (yes to some extent) • Delivering on time • Productivity • Economic Compensation • Desirable, but what matters is: • Self-motivation (making and creating stuff) • Inherently Passion (for the craft) • Prefer tools that are developer friendly (…Productive)

  16. WHAT

  17. What is RoR? “Ruby on RailsTM is an open source web application framework that is optimized for programmer happiness and sustainable productivity. It lets you write beautiful code by favoring convention over configuration.” Source: http://rubyonrails.org/ “…It is intended to be used with an Agile development methodology, which is often utilized by web developers for its suitability for short, client-driven projects.” Source: http://en.wikipedia.org/wiki/Ruby_on_Rails

  18. History • Ruby • Truly Object Oriented, dynamic, meta-programming language • Ruby 0.95 in 1995 • Current Release 1.9.1, most deployed Release 1.8.6 • Rails • Extracted by David Heinemeier Hansson (DHH) from Basecamp, a project management tool by 37signals. • CONSTANT CHANGE

  19. RoR is Agile • Manifesto for Agile Software Development • Responding to change over following a plan • Working software over comprehensive documentation • Customer collaboration over contract negotiation • Individuals and interactions over processes and tools

  20. Philosophy • DRY (Don’t Repeat Yourself) • CoC (Convention Over Configuration) – a.k.a “Smart defaults”. • Opinionated (.. and now with options) • Minimalist

  21. YAWF? (Yet Another Web Framework?)

  22. Not quite…

  23. Disruptive • Drastic reduction in development timelines. (1/10) • Prototypes are not thrown away, but rather evolved. • Shatters existing paradigms. • Large applications need complex tools • Enterprise Projects must use Enterprise tools. • Divide and Conquer (“Share nothing”) • The inner workings should be complex • Disposable implementation of business ideas is now possible. • Create, Extend and Mold your own tools to fit your own business domain not the other way around.

  24. Influential • Post-Rails Web Development Era: • Jboss Seam, Grails, Trails (Java) • ASP.NET MVC (.Net ) • Cake, PhpOnTrax (PHP) • Django, Subway (Phyton) • Catalyst, Perl on Rails (Perl) • Future new Frameworks are measured against RoR, in terms of ease of use, simplicity, extensibility and practicality.

  25. RoR and the Organizational Culture • Practical • Trust • Ownership goes in parallel with Responsibility • No database “hugging”. • Change is OK “We had really somewhat missed the Internet boat” Richard Roy – General Manager Microsoft Dec. 1995

  26. “Web Development for All” • Effectively lowering the barrier of entry to Web Application Development, without losing capabilities or ability to implement features. • Heavily reliant on Ruby’s dynamic behaviour • “A script collection SD toolkit”1 for both highly experienced and entry-level developer • RoR can be understood as a “Domain Specific Language (DSL) for developing web applications. “

  27. It is everywhere…

  28. 2009 Fukuoka Ruby Award • Government of Fukuoka Japan raises public awareness of the growing software industry and Ruby www.f-ruby.com

  29. HOW

  30. ROR Basics

  31. Features • Open Source • MVC • RESTful web architecture • Single Stack • Default Pluggable Single Stack (Rails 3.0) • Minimalist • Integrated Testing

  32. Support in Closed-Source Software Software Company Incident Solution Client $$$

  33. Support in OSS Source Code RoR API Docs Interchange User Mailing Lists Forums

  34. MVC 2.Event Handler 3.Compute Action 5. Render View 1. User Interaction 6. Read model 4. Read/Write model to database

  35. RESTful DATABASE Create Read Update Delete WEB (HTTP) Post Get Put Delete URLs /my-app/clients/new /my-app/clients/1 /my-app/clients/1/edit /my-app/clients/1 • Standard extensible and scalable integration (internal/external)

  36. Single Stack APPLICATION LAYERS Database Layer Presentation Layer Business Logic Middleware (M,L) RoR Stack ActiveRecord ActionView Ruby / DSL ActiveResource • BENEFITS: • Less integration hassles • Improvements in the framework work across layers • Layers are optional

  37. Default Pluggable Stack • Model Mapping (ORM) • Active Record … or Data Mapper or Sequel • View Templates • ERb…. or Haml • Ajax • Prototype/Scriptaculous…. Or JQuery • Controller • ActionController… or Rails Metal/Rack

  38. Minimalist • Minimal instruction that performs one task well • Additional optional parameters • Core is shrinking, extensible features via plug-ins

  39. Integrated Testing • Automated test is critical to accelerate testing and avoid regression defects • Test coverage (80/20) - Critical for non-compiled languages • RoR Testing Artifacts • Fixtures • Functional • Integration • Unit • Mocks

  40. WHERE

  41. Multiplatform • MRI (Matz’s Ruby Interpreter) • MRI 1.8.6 is widely deployed • MRI 1.8.7 intended as intermediate step towards 1.9.1 • Current Release 1.9.1 (… but wait!) • Jruby • Release version: JRuby1.1.6 (Update: JRuby1.2.0 RC2) • Compatible w/ MRI 1.8.6 support for 1.9 • Rubinius • Not 100% Rails compatible yet • IronRuby • Still Alpha

  42. Deployments • Self-hosting • Traditional Mongrel cluster • Passenger • Cloud Computing • Simple, simpler, simplest

  43. Considerations when using RoR • Encapsulating elements • Create your own APIs (abstractions) when possible • Automation, automation, automation • Source Code Version Control • Old code is commented out • DB assets not under version control • Refactor code as well as your DB Schema • Ref: www.ambysoft.com/books/refactoringDatabases.html

  44. Getting Ruby and RoR • Your favourite database • SQLite (default Rails development database) • MySQL (appropiate for most projects) • PostgreSQL (transactional applications) • http://www.ruby-lang.org/en/downloads • http://www.rubyonrails.org/download

  45. RUBY DEMO

  46. RoR DEMO

  47. Future (Present?) for RoR

  48. “Living interesting times” • Rails - Rails 3.0 (Summer…ish 2009) • Merging MERB/ project into Rails • Progress underway with Rails 2.3 • Rails Metal and Rack • Github – Social code sharing • Ruby • Ruby 1.9.1 • Block variable scope, Additional Lambda syntax, String encoding • Other options materialize (Rubinius/IronRuby)

  49. Conclusions

More Related