IDUG NA 2007 Leon Katsnelson: Ruby on Rails: Introducing a Real

IDUG NA 2007 Leon Katsnelson: Ruby on Rails: Introducing a Real

F10, F11 Ruby on Rails: Introducing a real gem of DB2 application development Leon Katsnelson IBM Toronto Lab Wednesday, May 9, 2007 • 1:40 p.m. – 4:00 p.m. Platform: Cross Platform 1 Attend this session and receive a CD-ROM that contains everything you need to get started with learning DB2 Ruby on Rails programming including: -“Programming Ruby” book (PDF) – a must have book for anybody learning Ruby -Flash tutorials so you can replay them after the conference -Presentation materials for this session -A free copy of DB2 Express–C 9 -Latest copy of Ruby -Latest copy of the Rails framework -DB2 Ruby driver and DB2 Rails adapter Materials will also be made available for download on the “Members Area” of the IDUG website after the conference and from http://www.alphaworks.ibm.com/tech/db2onrails. 2 2 Agenda • Ruby: a gem of a language • Rails: web-based framework for database applications • DB2 on Rails: everything you need to get started • Project Aurora: You really have to see it to believe it! 3 3 What is “Ruby”? RubyRubyisis aa reflectivereflective,, object-orientedobject-oriented programmingprogramming languagelanguage.. ItIt combinescombines syntaxsyntax inspiredinspired byby PerlPerlwithwith SmalltalkSmalltalk-like-like object-object- orientedoriented features,features, andand alsoalso sharesshares somesome featuresfeatures withwith PythonPython,, LispLisp,, DylanDylanandand CLUCLU.. RubyRuby isis aa single-passsingle-pass interpretedinterpreted languagelanguage.. ItsIts mainmain implementationimplementation isis freefree softwaresoftware distributeddistributed underunder anan open-sourceopen-sourcelicense.license. Source: Wikipedia.org 4 Two most important facts about Ruby are the fact that it is a scripting language and that it is I an object-oriented language. 4 Sounds very similar to … PerlPerl,, alsoalso PracticalPractical ExtractionExtraction andand ReportReport LanguageLanguage(a(a backronymbackronym,, seesee belowbelow)) isis aa dynamicdynamicproceduralprocedural progprogrammingramming languagelanguage designeddesigned byby LarryLarry WallWallandand firstfirst releasedreleased inin 19871987.. PerlPerl borrowsborrows featuresfeatures fromfrom CC,, shellshell scriptingscripting ((shsh),), AWKAWK,, sedsed,, LispLisp,, and,and, toto aa lesserlesser extent,extent, manymany otherother prprogrammingogramming languages.languages. Source: Wikipedia.org 5 Perl is also a scripting language and it was a strong influence on Ruby. However, Perl is a procedural programming language and does not even pretend to be object-oriented. 5 And similar to … PHPPHP((PPHP:HP: HHypertextypertext PPreprocessor)reprocessor) isis anan openopen sourcesource,, reflectivereflectiveprogrammingprogramming languagelanguage.. OriginallyOriginally designeddesigned asas aa highhigh levellevel scriptingscripting languagelanguageforfor producingproducing dynamicdynamic WebWeb pagespages,, PHPPHP isis usedused mainlymainly inin server-sideserver-side applicationapplication softwaresoftwarebutbut cancan bebe executedexecuted fromfrom aa commandcommand lineline interfaceinterfaceoror aa standstand alonealone GUIGUI.. ItIt isis thethe fifthfifth momostst popularpopular programmingprogramming languagelanguage inin useuse today.today. Source: Wikipedia.org 6 PHP is another popular scripting language. While originally it was a pure procedural language, lately it has been given object-oriented features. 6 … and isn’t this the same as … Python®Python® is is aa dynamicdynamic object-orientedobject-oriented programmingprogramming languagelanguagethatthat cancan bebe usedused forfor manymany kindskinds ofof softwaresoftware development.development. ItIt offersoffers strongstrong supportsupport forfor integrationintegration withwith otherother languageslanguages andand tools,tools, comescomes withwith extensiveextensive standardstandard libraries,libraries, andand cancan bebe learnedlearned inin aa fewfew days.days. ManyMany PythonPython programmersprogrammers reportreport substantialsubstantial productivityproductivity gainsgains andand feelfeel thethe languagelanguage encouragesencourages thethe developmentdevelopment ofof higherhigher quality,quality, moremore maintainablemaintainable code.code. Source: python.org 7 Python is anohter scripting language 7 What is Rails? full-stack framework for database-backed web applications implements the model-view-control (MVC) architecture written in Ruby incredibly productive easy to use, conventions over configuration one of the fastest emerging web framework since 2004 8 Then talk about rails 8 Number of developers has growing briskly with double digit growth expected to yield 13M developers worldwide in 2006. Through 2009, AP will drive the majority of growth as its WW share increases from 33% to 40% while overtaking EMEA. 2004 2005 2006 2007 2008 2009 Developers (000) 10,999 12,059 13,354 14,795 16,399 18,174 Growth (%) n/a 9.6% 10.7% 10.8% 10.8% 10.8% Professional Developers By Geo 2006 Professional Developers By Geo 2009 18% 23% 36% 35% 7% 7% 40% 34% EMEA AP LA NA EMEA AP LA NA Source: IDC Population Model9 2005-2006 India, China, Russia and Japan will constitute almost 30% of developer population. 9 The BIG THREE 10 10 TPC Index http://www.tiobe.com/tpci.htm 11 11 TIOBE – Popular programming languages (jobs) 12 12 Is Ruby on Rails the next Java? • Some of the most respected Java people think so • Enterprise qualities (MVC) but several orders of magnitude more productive • All-n-one framework: no assembly required, batteries included 13 13 Is Ruby on Rails the next Java? “(Bruce) Tate says it shook him to his Java-loving core when the Rails rewrite took four nights of coding when compared to four months for the Java build, then outperformed the Java version while weighing in at about the fifth the number of lines of code” -Michael Swaine, Dr. Dobb’s Journal 14 14 Is Ruby on Rails the next PHP? • Many respected PHP people think so • Speed of development but with scalability, performance and discipline the enterprise needs • Similar demographic as PHP but much faster adoption curve • PHP community is trying to respond with their own MVC frameworks but most PHP programmers are not embracing MVC (skill impedance mismatch) 15 15 “Rails is the most well thought-out web development framework I’ve ever used. And that’s in a decade of doing web applications for a living. I’ve built my own frameworks, helped develop the Servlet API, and have created more than a few web servers from scratch. Nobody has done it like this before.” -James Duncan Davidson, Creator of Tomcat and Ant “It is impossible not to notice Ruby on Rails. It has had a “Ruby on Rails is a breakthrough in lowering huge effect both in and outside the Ruby community... the barriers of entry to programming. Powerful Rails has become a standard to which even well- web applications that formerly might have established tools are comparing themselves to.” taken weeks or months to develop can be -Martin Fowler, Author of Refactoring, PoEAA, XP produced in a matter of days.” Explained -Tim O'Reilly, Founder of O'Reilly Media “Ruby on Rails is astounding. Using it is like “After researching the market, Ruby on Rails stood out watching a kung-fu movie, where a dozen bad- as the best choice. We have been very happy with that ass frameworks prepare to beat up the little decision. We will continue building on Rails and newcomer only to be handed their asses in a consider it a key business advantage.” variety of imaginative ways.” -Evan Williams, Creator of Blogger and ODEO -Nathan Torkington, O'Reilly Program Chair for OSCON 16 16 Ruby on Rails Momentum: red hot! • Ruby invented by Yukihiro Matsumoto aka "Matz", 1995; • Rails: • invented by David Heinemeier Hansson (DHH), late 2004 while still in university • Rails 1.0 ships December 24, 2005 • Rails 1.1 ships 3 months later • Rails is only 10 month old and is already the hottest IT topic of today • In 2005 less then a dozen ISPs provide RoR hosting. In 2006, most major ISPs host RoR • Google buys RoR company in 2005; runs Summer of Code RoR projects in 2006 17 17 Ruby on Rails Momentum: red hot! • First Rails conference held in 2005, 90 people attended. RailsConf 2006 sold out in 5 days. Added 150 seats and sold them in 24 hours. We are a sponsor! • Other Rails and Ruby conferences sols out (eg. CanadaOnRails) • Rails won the Jolt Award for the best web framework. Rails book won the best book award. • Rails book sold 25K copies in less then a month. • Agile Development With Rails is one of the best selling programming books ever. Every major publisher is releasing a book(s) on RoR. • Over 500000 copies of Rails downloaded • DHH voted 2005 Hacker of the Year at the OSCON • DHH voted by Business 2.0 magazine as one of “the 50 who matter now” people 18 18 Ruby: a gem of a language 19 19 Ruby is a scripting language Compiled languages Scripting languages • <xmp>COBOL, C, C++, • <xmp>PERL, PHP, Python, PLI</xmp> Ruby</xmp> • Source code is transformed • Source code is interpreted by a compiler in to byte code every time it is invoked that can be executed by a • Applications are distributed in particular machine the source form i.e. no architecture executable (code can be • Executable code is distributed obfuscated to protect to the application users intellectual property) • Changes made to the source • Changes to source are need to be recompiled reflected in the execution immediately 20 20 Ruby is object oriented • Everything is an object; there are no base types • Every function is a method • Variables are references to

View Full Text

Details

  • File Type
    pdf
  • Upload Time
    -
  • Content Languages
    English
  • Upload User
    Anonymous/Not logged-in
  • File Pages
    80 Page
  • File Size
    -

Download

Channel Download Status
Express Download Enable

Copyright

We respect the copyrights and intellectual property rights of all users. All uploaded documents are either original works of the uploader or authorized works of the rightful owners.

  • Not to be reproduced or distributed without explicit permission.
  • Not used for commercial purposes outside of approved use cases.
  • Not used to infringe on the rights of the original creators.
  • If you believe any content infringes your copyright, please contact us immediately.

Support

For help with questions, suggestions, or problems, please contact us