1 / 31

Ruby on Rails (CS564 presentation)

Ruby on Rails (CS564 presentation). Presenter: Goran Savovski Professor: Walter Maner. Introduction. The fast pace in the software development The question: What comes next? . Trends for the top 10 languages. source: http://www.tiobe.com/index.htm?tiobe_index.

LionelDale
Download Presentation

Ruby on Rails (CS564 presentation)

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. Ruby on Rails(CS564 presentation) Presenter: Goran Savovski Professor: Walter Maner

  2. Introduction • The fast pace in the software development • The question: What comes next?

  3. Trends for the top 10 languages source: http://www.tiobe.com/index.htm?tiobe_index

  4. Web 2.0 • A new term coined recently • New possibilities • Wiki, Social Software, Podcast, RSS feed, Mashups, Web Applications… • Combining existing technologies • HTML , CSS , JavaScript, SQL, XML, AJAX..

  5. The Origins of Ruby on Rails (RoR) • What is RoR? • Ruby (Yukihiro Matsumoto 1993, Japan) • Rails (David Heinemeier Hansson 2003, Denmark) • Where comes RoR into play?

  6. RoR Philosophy • Model-View –Controller • DRY – Don’t Repeat Yourself • Less Code • Convention over Configuration • Agile Development

  7. Model-View-Controler image source: D. Thomas, D.H. Hansson, Agile Web Development with Rails, 2nd ed., New York, USA: Pragmatic Programmers LLC, 2007.

  8. RoR enforces Agile Development • Incremental Development • Prototyping • Testing • Early Integration

  9. Some Ruby features • Ruby is a single-pass interpreted language • Everything is an object • Every function is a method • Four levels of variable scope: global, class, instance, and local • Perl-like regular expressions • Automatic garbage collecting • Highly portable • Every variable is completely private; exposed through accessor methods (attr_writer, attr_reader) • Interactive Ruby Schell (IRB)

  10. Ruby sintax • The nesting indentions are 2 blank spaces • Now semicolon needed at the and of the line • Boolean 0, “”, [] all evaluates as true only nil and false evaluates as false • Code blocks defined without braces (e.i. pair of { and})

  11. Ruby code snipets[11] • -199.abs # 199 • "ruby is cool".length # 12 • “Ruby".index(“b") # 2 • array = [1, 1, 'hi', 3.14] • array |= [2] # [1, 1, 'hi', 3.14, 2] • array.reverse # [2, 3.14, 'hi', 1 ,1 ] • array.uniq # [2, 3.14, 'hi', 1 ] • array.each {|item| puts item} • # => 1 • # => 'hi' • # => 3.14

  12. Common Critique on RoR[4] • Scalability • Enterprise level support • Web Hosting • IDE (integrated development environment) • Constraint by only one framework • Deployment Configuration

  13. Scalability -Example of Real world solution Source: http://poocs.net/2006/3/13/the-adventures-of-scaling-stage-1

  14. Enterprise level support • Large number of supporting Databases including Oracle • JRuby • IronRuby • Mac OS - Leopard

  15. Web Hosting Services that support RoR in North America 3SHost, 10for10, A2 Hosting, AFMU.com, ADM HostingAetheri Hosting, AmbitiousLemon, Apis Networks, AxisHOST.com , A Small Orange, Blizzard Media, BlueHost , Blue Box Grid, Bright-Byte.com, CanadianWebHosting.com, Csoft.org, CommandPrompt.Com, Cybersalad, DewaHost, Dinohost, DomainGurus, Dotnoc IT Services, DreamHost, DowntownHost, Duport Online, eApps Hosting’s Ruby on Rails Hosting, EastSolid.com, Eferi, EngineYard.com, eTecc.net, EZserver.biz, Fuse9, Gazzin.com, Gigenet, GeekISP, GeekStorage, GoDaddy, GoJimmers, GrokThis.net, High Speed Rails, Honeycomb, HostedToday, HostM.com Web Hosting, HostingMetro.com, HostMG.com, HostMonster, HostMySite, HostPC Internet Services, Hub.org, JaguarPC , Linode.com, LI Webhosting, max-king Hosting, Media Temple, MonkeyWrench Hosting, MonsterHosting.ca, Mosquito Mole Multiworks, MysticServer, NeonCube Internet Solutions, Netfirms, NetworkRedux, OCS Solutions, OpenHosting, PeconiHosting.com, Pipespring, HPWebHosting, PLANET ARGON, Plutomic Hosting, Python-Hosting.com, RailsBase, RailsPlayground.com, RailsHosting.org, Rails Hosting Info, Rails Machine, RailsWebHost.com, RimuHosting Ruby on Rails Hosting, RootR, RoundBerry, RubyOnRailsHosting.net , SeattleServer.com, Server Powered, Simplehost, Site5, SliceHost, soyhost, Squidhost.com, Steelpixel.com, SilverRack, SuccessfulHosting.com, SunsetHost.com, TerraBox.com, TextDrive, The Internet Company, TheSitePeople, ThinkHost, Voxxit, Web Experts America, WebAppCabaret, WebOnce Technologies, Webslum Internet Services, WestHost , Xelhosting.com,XMG Free, XMG Hosting,WebFaction, Zettai

  16. Integrated development environment • IDE (integrated development environment) • Aptana Studio with RadRails Development Plugin (free) • RadRails Plugin for Eclipse (free) • NetBeans support for RoR development (free) • Rubi in Steel by Visual Studio ($199) • Komodo by Active State ($295) • 3rdRail by CodeGear ($299)

  17. RoR lightweight editors • Mac • Textmate (the ultimate RoR editor, but $39.95) • Windows • E-Texteditor (referred as the power of Textmate on windows, $34.95) • Programmers Notepad (very fast, my choice, free) • Notepad ++ (free) • Unix • Emacs • Vim

  18. Deployment Configuration Deployment with Capistrano [13]

  19. Constraint by only one framework • Other Ruby based frameworks • Merb • Sequel • DataMapper • Ambition

  20. Web Applications using RoR[10] • Basecamp – online project management • BBC Programme Catalogue – video and audio archives from BBC television and radio • Blurb.com – personal book publishing • ChaCha.com - a human-powered search engine • Justin.tv - A live video streaming platform • LinkedIn - Professional-oriented Social Networking Service • OpenCongress – Aggregated news and official data about the US Congress • Penny Arcade – gamer-humor webcomic • Revolution Health – a health portal • Twitter – micro-blogging service • World Stock Exchange – Internet based Stock Exchange for the virtual world of Second Life • yellowpages.com – US telephone directory

  21. The Rails Architecture • Active Record • Action Pack • ActionController • ActionView • Active Support • Action Mailer • Action Web Service

  22. Rails features • skeleton code (scaffolding) • Autowiring (automapping) of the MVC • convention over configuration • unit and integration test • Capistrano • script/console. • Rake • Built in Ajax support by using Prototype and Script.aculo.us

  23. The “Hello World” steps [13] • Create an application: • rails MyProject • Go into the projects folder and start the development server WeBRICK: • cdMyProject • ./script/server • Open your browser on this location • http://localhost:3000

  24. The “Hello World” steps (cont’d)

  25. The “Hello World” steps (cont’d) • Generate the controler: • ./script/generate controller hello index • Open the the hello controller in your favorite editor and add: • def world @greeting= “hello world!” end • Now open the world view in MyProject/views/hello/world.rhtml and add • <%= @greeting %> • Now open the http://localhost:3000/hello/world in your browser and that is it!

  26. Auto mapping image source: D. Thomas, D.H. Hansson, Agile Web Development with Rails, 2nd ed., New York, USA: Pragmatic Programmers LLC, 2007.

  27. Did Ruby on Rails succeed? image source: http://beust.com/weblog/archives/000382.html

  28. Thank you for you attention! • Questions, Comments, Critique? Matz & David

  29. References • [1] Kay Russell, “Ruby on Rails,” Computerworld, November 2005, Vol. 39 Issue 48, p26. www.computerworld.com. • [2] Wikipedia, “Ruby on Rails,” October 2007, [Online Document] available at http://en.wikipedia.org/wiki/Ruby_on_Rails. • [3] D. Thomas, D.H. Hansson, Agile Web Development with Rails, 2nd ed., New York, USA: Pragmatic Programmers LLC, 2007. • [4] C. Beust, “Why Ruby on Rails won't become mainstream” [Online Document] April 2006, Available at http://beust.com/weblog/archives/000382.html. • [5] G. Stark, “Java + Rails = Real Digital Media” [Online Document] 2007, Available at http://www.railsforall.org/case_studies/11. • [6] G. Grosenbach, “Future of Web Apps Conference” [Online Document] October 2007, Available at http://nubyonrails.com/. • [7] D. Sivers, “7 reasons I switched back to PHP after 2 years on Rails” [Online Document] September 22, 2007, Available at http://www.oreillynet.com/ruby/blog/2007/09/7_reasons_i_switched_back_to_p_1.html.

  30. References (cont’d) • [8] P. Lenz, “The adventures of scaling” [Online Document] March 2006, Available at http://poocs.net/2006/3/13/the-adventures-of-scaling-stage-1. • [9] I. Couto, “RailsWebHosts” [Online Document] November 2007, (last updated), Available at http://wiki.rubyonrails.com/rails/pages/RailsWebHosts. • [10] S. Bozhkov, “22 Successful Ruby On Rails Web Applications” [Online Document] March 2007, Available at http://rubycorner.net/articles/22-successful-ruby-on-rails-web-applications/. • [11] Ruby (programming language) [Onlinine Document] November 2007, http://en.wikipedia.org/wiki/Ruby_(programming_language) • [12] Ruby on Rails [Online Document] December 2007, Available at http://en.wikipedia.org/wiki/Ruby_on_Rails • [13] Ruby on Rails Tutorial [Online Document] December 2007, Available at http://wiki.rubyonrails.org/rails/pages/Tutorial • [14] Capistrano: Simple. The way it should be. Available at: http://www.capify.org/getting-started/basics

  31. Additionall Sources • Rails podcast: http://podcast.rubyonrails.org • RoR workshops (USA): http://rubyonrailsworkshops.com/countries/show/228 • Mashup (JobMapper) using RoR http://saush.com/blog/?page_id=52 • Resources for RoR development http://rubycorner.net/ • Videos from RailsConf 2006 http://blog.scribestudio.com/pages/rails/ (there are no videos posted anywhere from RailsConf 2007) • Nice inspirational article: http://www.cio.com/article/125851/Why_Ruby_on_Rails_Succeed • Very bragging like podcast, but ok once you get used to the tone: http://railsenvy.com/

More Related