0
Getting On Board Ruby on Rails <ul><li>Brian Hogan and Lillian Hillis </li></ul><ul><li>University of Wisconsin – Eau Clai...
Getting On Board Ruby On Rails <ul><li>Framework is two years old </li></ul><ul><li>New way to develop web-based applicati...
Getting On Board Ruby On Rails <ul><li>New web-to-database systems </li></ul><ul><li>Migrations from existing PHP, ASP, or...
Getting On Board Ruby On Rails <ul><li>Simple scripts </li></ul><ul><li>Non-web projects </li></ul><ul><li>Complex systems...
Getting On Board Ruby On Rails <ul><li>Web-based administrative systems for administrative and academic offices </li></ul>...
Getting On Board Ruby On Rails <ul><li>Rapid prototyping </li></ul><ul><li>Built-in testing </li></ul><ul><li>Easy to main...
Getting On Board Ruby On Rails Who’s Using Rails <ul><li>Penny Arcade </li></ul><ul><li>AListApart </li></ul><ul><li>Gusto...
 
 
Getting On Board Ruby On Rails Rails and the MVC Pattern <ul><li>Model - View - Controller </li></ul><ul><li>Rails follows...
 
Getting On Board Ruby On Rails Models <ul><li>Provide access to database tables </li></ul><ul><li>Contain business rules <...
Model <ul><li>Models also define validations and associations with other models. </li></ul>
Getting On Board Ruby On Rails Models Provided by mboffin.com
Getting On Board Ruby On Rails Controllers <ul><li>Handle user requests </li></ul><ul><li>Retrieve data from models </li><...
Controllers <ul><li>Here’s a basic controller action to display a blog post </li></ul><ul><li>The URL would be /blog/show/...
Getting On Board Ruby On Rails Views <ul><li>The user screens or web pages of your applications </li></ul><ul><li>Should c...
View <ul><li>Views are similar to PHP or ASP pages </li></ul><ul><li>Much more powerful </li></ul><ul><li>Partials can be ...
Getting On Board Ruby On Rails Rails-specific MVC components <ul><li>Helpers </li></ul><ul><li>Partials </li></ul><ul><li>...
Getting On Board Ruby On Rails Helpers <ul><li>Place to put presentation logic </li></ul><ul><li>Available to Views and co...
Getting On Board Ruby On Rails Partials <ul><li>Pieces of view code that can be reused </li></ul><ul><ul><li>Can be applie...
Getting On Board Ruby On Rails Layouts <ul><li>Your templates are here. </li></ul><ul><li>Global or controller-specific </...
Layouts Your rendered view is inserted here!
Getting On Board Ruby On Rails Migrations <ul><li>Database-independent schema definition </li></ul><ul><li>Incrementally d...
Getting On Board Ruby On Rails Scaffolding <ul><li>Generation of controllers and views based on model definition </li></ul...
Getting On Board Ruby On Rails Demo!
Getting On Board Ruby On Rails Scalability <ul><li>Rails scales horizontally </li></ul><ul><li>When load is too high, brin...
Getting On Board Ruby On Rails Scalability (continued) <ul><li>Know your current requirements </li></ul><ul><li>“ 100 user...
Getting On Board Ruby On Rails Performance <ul><li>Rails performs on par with other languages </li></ul><ul><li>Slower on ...
Getting On Board Ruby On Rails Deployment <ul><li>Linux is the best for deployment </li></ul><ul><li>Windows is supported ...
Deployment
Getting On Board Ruby On Rails Security <ul><li>Security is a people problem </li></ul><ul><ul><li>Developers must ensure ...
 
Choosing a Development Language <ul><li>MyDecisionHelper </li></ul><ul><ul><li>Helps you make critical decision using a pa...
Getting On Board Ruby On Rails Resources - Books <ul><li>Learn to Program  (Chris Pine) </li></ul><ul><li>Agile Web Develo...
Getting On Board Ruby On Rails Resources – Web Sites <ul><li>www.rubyonrails.org </li></ul><ul><li>wiki.rubyonrails.com </...
Getting On Board Ruby On Rails Resources – Mailing List <ul><li>groups.google.com/group/rubyonrails -talk </li></ul>
Getting On Board Ruby On Rails Resources - Other <ul><li>#rubyonrails on irc.freenode.org </li></ul><ul><li>Email Brian an...
Getting On Board Ruby On Rails Thanks for coming!
Getting On Board Ruby on Rails <ul><li>Brian Hogan </li></ul><ul><li>[email_address] </li></ul>Lillian Hillis [email_addre...
Upcoming SlideShare
Loading in...5
×

RubyonRails

1,225

Published on

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

No Downloads
Views
Total Views
1,225
On Slideshare
0
From Embeds
0
Number of Embeds
0
Actions
Shares
0
Downloads
58
Comments
0
Likes
2
Embeds 0
No embeds

No notes for slide

Transcript of "RubyonRails"

  1. 1. Getting On Board Ruby on Rails <ul><li>Brian Hogan and Lillian Hillis </li></ul><ul><li>University of Wisconsin – Eau Claire </li></ul>
  2. 2. Getting On Board Ruby On Rails <ul><li>Framework is two years old </li></ul><ul><li>New way to develop web-based applications </li></ul><ul><li>Lots of converts from other languages </li></ul>What's the buzz
  3. 3. Getting On Board Ruby On Rails <ul><li>New web-to-database systems </li></ul><ul><li>Migrations from existing PHP, ASP, or Perl systems </li></ul><ul><li>An alternative to non-Enterprise J2EE systems </li></ul><ul><ul><li>Systems in that gap between simple scripts and complex enterprise systems </li></ul></ul>When to use Rails
  4. 4. Getting On Board Ruby On Rails <ul><li>Simple scripts </li></ul><ul><li>Non-web projects </li></ul><ul><li>Complex systems with legacy databases </li></ul><ul><ul><li>Possible to do but you will lose productivity gains </li></ul></ul>When NOT to use Rails
  5. 5. Getting On Board Ruby On Rails <ul><li>Web-based administrative systems for administrative and academic offices </li></ul><ul><ul><li>Housing and Residence Life </li></ul></ul><ul><ul><li>Student Health Services </li></ul></ul><ul><ul><li>Music and Theater Arts </li></ul></ul><ul><ul><li>Continuing Education </li></ul></ul><ul><li>Developed by student developers </li></ul><ul><ul><li>New developers every couple of years </li></ul></ul><ul><ul><li>Team-based approach whenever possible </li></ul></ul>How UW-Eau Claire Uses It
  6. 6. Getting On Board Ruby On Rails <ul><li>Rapid prototyping </li></ul><ul><li>Built-in testing </li></ul><ul><li>Easy to maintain and upgrade </li></ul><ul><li>Friendly user community </li></ul><ul><li>Easy to learn, embrace and extend </li></ul><ul><li>It’s agile! </li></ul>Key Benefits
  7. 7. Getting On Board Ruby On Rails Who’s Using Rails <ul><li>Penny Arcade </li></ul><ul><li>AListApart </li></ul><ul><li>Gusto </li></ul><ul><li>Shopify </li></ul><ul><li>Strongspace </li></ul><ul><li>Yakima-Herald Telegram </li></ul><ul><li>Subtopic </li></ul>
  8. 10. Getting On Board Ruby On Rails Rails and the MVC Pattern <ul><li>Model - View - Controller </li></ul><ul><li>Rails follows this pattern very strictly </li></ul><ul><li>Rails adds some extra components to this pattern </li></ul>
  9. 12. Getting On Board Ruby On Rails Models <ul><li>Provide access to database tables </li></ul><ul><li>Contain business rules </li></ul><ul><ul><li>Record CRUD (Create, Read, Update, Delete) </li></ul></ul><ul><li>An instance represents a row in a table </li></ul><ul><ul><li>Grade model instance => one row from ‘grades’ table </li></ul></ul>
  10. 13. Model <ul><li>Models also define validations and associations with other models. </li></ul>
  11. 14. Getting On Board Ruby On Rails Models Provided by mboffin.com
  12. 15. Getting On Board Ruby On Rails Controllers <ul><li>Handle user requests </li></ul><ul><li>Retrieve data from models </li></ul><ul><li>Invoke methods on models </li></ul><ul><li>Send views and responses to users </li></ul><ul><li>Should contain no business logic </li></ul><ul><ul><li>Only flow control </li></ul></ul>
  13. 16. Controllers <ul><li>Here’s a basic controller action to display a blog post </li></ul><ul><li>The URL would be /blog/show/1 </li></ul>
  14. 17. Getting On Board Ruby On Rails Views <ul><li>The user screens or web pages of your applications </li></ul><ul><li>Should contain no business logic </li></ul><ul><li>Should not know about models </li></ul><ul><li>Should contain very little presentation logic whenever possible </li></ul><ul><ul><li>Helpers are used for this </li></ul></ul>
  15. 18. View <ul><li>Views are similar to PHP or ASP pages </li></ul><ul><li>Much more powerful </li></ul><ul><li>Partials can be used to make our work easier </li></ul>
  16. 19. Getting On Board Ruby On Rails Rails-specific MVC components <ul><li>Helpers </li></ul><ul><li>Partials </li></ul><ul><li>Layouts </li></ul>
  17. 20. Getting On Board Ruby On Rails Helpers <ul><li>Place to put presentation logic </li></ul><ul><li>Available to Views and controllers </li></ul><ul><li>Rails has hundreds of built-in helpers for your views </li></ul><ul><li>Easy to make your own </li></ul>
  18. 21. Getting On Board Ruby On Rails Partials <ul><li>Pieces of view code that can be reused </li></ul><ul><ul><li>Can be applied to a collection of data! </li></ul></ul><ul><li>Designed to be shared across multiple views </li></ul><ul><li>Examples </li></ul><ul><ul><li>Form fields for Create and Update pages </li></ul></ul><ul><ul><li>Search results </li></ul></ul><ul><ul><li>Tables </li></ul></ul><ul><ul><li>Table rows </li></ul></ul>
  19. 22. Getting On Board Ruby On Rails Layouts <ul><li>Your templates are here. </li></ul><ul><li>Global or controller-specific </li></ul><ul><li>No need for header and footer separation </li></ul><ul><ul><li>Rails reads the template last and places your application within the content region </li></ul></ul><ul><li>Easy for designers to create layouts without knowing Rails </li></ul>
  20. 23. Layouts Your rendered view is inserted here!
  21. 24. Getting On Board Ruby On Rails Migrations <ul><li>Database-independent schema definition </li></ul><ul><li>Incrementally define your database </li></ul><ul><li>Makes creation and recreation easy! </li></ul>I’m platform-independent!
  22. 25. Getting On Board Ruby On Rails Scaffolding <ul><li>Generation of controllers and views based on model definition </li></ul><ul><li>Not meant for production use! </li></ul><ul><ul><li>Needs tweaking first </li></ul></ul>
  23. 26. Getting On Board Ruby On Rails Demo!
  24. 27. Getting On Board Ruby On Rails Scalability <ul><li>Rails scales horizontally </li></ul><ul><li>When load is too high, bring up another instance of the app & load balance your traffic </li></ul><ul><li>Simple solutions for load-balancing </li></ul><ul><ul><li>Apache 2.2 + mod_proxy_balance </li></ul></ul><ul><ul><li>Pound </li></ul></ul><ul><ul><li>Pen (Easy but no SSL support) </li></ul></ul><ul><ul><li>Lighttpd + mod_proxy </li></ul></ul>
  25. 28. Getting On Board Ruby On Rails Scalability (continued) <ul><li>Know your current requirements </li></ul><ul><li>“ 100 users at the same time” isn’t a good benchmark </li></ul><ul><ul><li>Simultaneous actions don’t happen all the time </li></ul></ul><ul><li>Think “requests per second” </li></ul><ul><ul><li>Measure your existing apps and see how Rails compares. </li></ul></ul><ul><li>Your database is often the first scalability problem you’ll encounter in any web application </li></ul><ul><ul><li>Databases can be clustered </li></ul></ul>
  26. 29. Getting On Board Ruby On Rails Performance <ul><li>Rails performs on par with other languages </li></ul><ul><li>Slower on Windows </li></ul><ul><ul><li>Limitation of compiled Ruby on Windows </li></ul></ul><ul><li>My tests on similar hardware </li></ul><ul><ul><li>7 req/sec to 35 req/sec on Windows </li></ul></ul><ul><ul><li>30 req/second to 150 req/second on Linux </li></ul></ul><ul><li>Increase load by adding more “dispatchers” and load-balancing them </li></ul>
  27. 30. Getting On Board Ruby On Rails Deployment <ul><li>Linux is the best for deployment </li></ul><ul><li>Windows is supported </li></ul><ul><ul><li>IIS won’t work well, if at all </li></ul></ul><ul><ul><li>Simple workarounds for this exist </li></ul></ul><ul><li>Shared Hosting providers supporting Rails </li></ul><ul><ul><li>Dreamhost (Great for personal stuff) </li></ul></ul><ul><ul><li>BlueHost </li></ul></ul><ul><ul><li>RailsPlayground </li></ul></ul><ul><li>High-availability providers </li></ul><ul><ul><li>RailsMachine </li></ul></ul><ul><ul><li>EngineYard </li></ul></ul>
  28. 31. Deployment
  29. 32. Getting On Board Ruby On Rails Security <ul><li>Security is a people problem </li></ul><ul><ul><li>Developers must ensure security of their code and data </li></ul></ul><ul><ul><li>System admins must keep their systems up to date </li></ul></ul><ul><li>Rails has built-in mechanisms for preventing SQL injection and XSS </li></ul><ul><li>Rails is as secure as any other server-side language </li></ul><ul><li>How secure is your platform underneath the web application? </li></ul>
  30. 34. Choosing a Development Language <ul><li>MyDecisionHelper </li></ul><ul><ul><li>Helps you make critical decision using a patent-pending decision engine </li></ul></ul><ul><ul><li>Rails application developed by a team of five </li></ul></ul><ul><ul><ul><li>Two Rails programmers, one designer, one consultant, and one market analyst, each working less than 20 hours per week </li></ul></ul></ul><ul><ul><ul><li>Developers are new to Rails </li></ul></ul></ul><ul><ul><ul><li>One developer made more progress in one weekend than in 3 months with .Net! </li></ul></ul></ul><ul><ul><ul><li>What you see didn’t exist 2 months ago! </li></ul></ul></ul>
  31. 35. Getting On Board Ruby On Rails Resources - Books <ul><li>Learn to Program (Chris Pine) </li></ul><ul><li>Agile Web Development with Rails (Dave Thomas and David Heinemeier Hansson) </li></ul><ul><li>Ruby for Rails, Ruby techniques for Rails developers (David Black) </li></ul><ul><li>Programming Ruby (Dave Thomas) </li></ul><ul><li>Rails Recipes (Chad Fowler) </li></ul>
  32. 36. Getting On Board Ruby On Rails Resources – Web Sites <ul><li>www.rubyonrails.org </li></ul><ul><li>wiki.rubyonrails.com </li></ul><ul><li>api.rubyonrails.org </li></ul><ul><li>www.uwec.edu/webdev/ror for additional resources </li></ul>
  33. 37. Getting On Board Ruby On Rails Resources – Mailing List <ul><li>groups.google.com/group/rubyonrails -talk </li></ul>
  34. 38. Getting On Board Ruby On Rails Resources - Other <ul><li>#rubyonrails on irc.freenode.org </li></ul><ul><li>Email Brian any time </li></ul><ul><ul><li>[email_address] </li></ul></ul><ul><ul><li>[email_address] </li></ul></ul><ul><li>Contact Brian any time after the presentation </li></ul>
  35. 39. Getting On Board Ruby On Rails Thanks for coming!
  36. 40. Getting On Board Ruby on Rails <ul><li>Brian Hogan </li></ul><ul><li>[email_address] </li></ul>Lillian Hillis [email_address]
  1. A particular slide catching your eye?

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

×