SlideShare a Scribd company logo
1 of 36
JRuby
is
het
antwoord...
        maar
op
welke
vraag?

                               Koos
de
Wit
                            Wisdom
Ordina
                          6
november
2008


                                    1

vrijdag 7 november 2008                      1
Inhoudsopgave
                          1.   IntroducDe
                          2.   Wat?
                          3.   Waarom?
                          4.   Hoe?
                          5.   Voorbeelden
                          6.   Conclusie
                          7.   Vragen

                                             2

vrijdag 7 november 2008                          2
Introductie
                          • Werkzaam in ICT sinds 1990
                          • Per 1 september 2007 bij
                           Wisdom Ordina

                          • Software ontwikkeling en docent
                           informatica

                          • Sinds 1998 Javaan
                          • Sinds 2006 Ruby on Rails
vrijdag 7 november 2008                                       3
Wat is JRuby?


vrijdag 7 november 2008                   4
Wat is Ruby?
                  • Programmeertaal
                  • Ontwikkeld in 1993
                  • Door Yukihiro Matsumoto
                  • Objectgeörienteerd
                  • Geïnterpreteerd
                  • Dynamisch

vrijdag 7 november 2008                       5
Wat is Ruby? (2)
                  • Geschreven in C
                  • Ook wel Matz’ Ruby genoemd
                          (naar Yukihiro Matsumoto)

                  • http://www.ruby-lang.org
                  • Versie 1.8.6/7



vrijdag 7 november 2008                               6
Ruby on Rails
                   • Webapplication framework
                   • 2004
                   • David Heinemeijer Hanson
                   • Principes:
                          • Convention over configuration
                          • Don’t Repeat Yourself

vrijdag 7 november 2008                                     7
Ruby on Rails

            • Snelle ontwikkeling / geen compilatieslag
            • Model-View-Controller
            • ActiveRecord / Migraties
            • Web 2.0 / Ajax integratie
            • Ondersteuning voor testen


vrijdag 7 november 2008                                   8
Wat is JRuby?



vrijdag 7 november 2008                   9
JRuby == Ruby



vrijdag 7 november 2008                   10
Wat is JRuby?
                  • Ruby implementatie in de Java VM
                  • Compatibel met Ruby 1.8.6
                  • Compatibility d.m.v. testen
                  • Ruby spec site:
                          http://spec.ruby-doc.org

                  • Laatste JRuby versie is 1.1.5
                          http://www.jruby.org

vrijdag 7 november 2008                                11
Sun op J-Fall 2006




vrijdag 7 november 2008                        12
Java Platform
                                                                                  Java
                                                                                         Ruby

                                                                        JVM                Python
               JVM
                                Java                                                      ECMAScript

                                                                                             PHP

                          API
                                                                                  API



                                       Copyright(C) 2008 Sun Microsystems, Inc.                        4
vrijdag 7 november 2008                                                                                    13
Maar ...

                          JRuby ≠ Ruby


vrijdag 7 november 2008                  14
JRuby ≠ Ruby
                  • Native threaded
                  • No Native quot;Cquot; extentions
                          • Java extentions for
                            ActiveRecord-JDBC
                            RMagick4J
                            Mongrel

                  • No Continuations

vrijdag 7 november 2008                           15
Wat kun je met JRuby?

                  • Execute Ruby code in de JVM
                  • Access Java classes vanuit Ruby
                  • Access Ruby classes vanuit Java




vrijdag 7 november 2008                               16
Waarom?


vrijdag 7 november 2008             17
Waarom?

                          Twee invalshoeken:

                          • Vanuit de commercie
                          • Vanuit de techniek




vrijdag 7 november 2008                           18
Vanuit de commercie

                  • Opleveren wat de klant nodig heeft
                          i.p.v. wat de klant wil hebben

                  • Snellere time-to-market
                  • Manier om hierop aan te sluiten:
                          Agile development / SCRUM




vrijdag 7 november 2008                                    19
Scrum
intro
filmpje:
hPp://nl.youtube.com/watch?v=6s3mdDYzaKI




vrijdag 7 november 2008                                                                  20
vrijdag 7 november 2008   21
Vanuit de commercie
                  • Opleveren wat de klant nodig heeft
                          i.p.v. wat de klant wil hebben

                  • Snellere time-to-market
                  • Manier om hierop aan te sluiten:
                          Agile development / SCRUM

                  • Tools om hierop aan te sluiten


vrijdag 7 november 2008                                    22
Vanuit de techniek

           • (J)Ruby on Rails voor agile projecten
           • Java is voorgeschreven vanuit de klant




vrijdag 7 november 2008                               23
Vanuit de techniek
           • Gebruik van Java VM:
                  • Java Virtual Machine is stabiel en snel
                  • JVM is op veel platformen beschikbaar
                  • Bekende deployment en tuning
                  • Minder “politieke” weerstand
           • JRuby is sneller dan Ruby (volgens Sun)

vrijdag 7 november 2008                                       24
Charles Nutter
                          op RubyEnRails 2008:

       “If JRuby is slower than Ruby,
                               file a bug”


vrijdag 7 november 2008                          25
Hoe?


vrijdag 7 november 2008          26
Hoe?
                  • Download en unzip jruby.zip
                  • Add JRuby.jar to the classpath
                  • Install gems (libraries) such as Rails
                  • Use command line tools like IRB,
                          rake, etc.




vrijdag 7 november 2008                                      27
Hoe?

                  • Ontwikkelen en deployen van
                          (J)Ruby on Rails webapplicaties

                  • Swing applicaties
                  • Mix van Java en Ruby
                          (obv scriptengines)




vrijdag 7 november 2008                                     28
Hoe?
                 Deploy Rails applicatie
                  • via WAR-file
                          Genereer WAR-file met warbler gem
                          gebaseerd op JRuby-Rack

                  • via Directory based deploy
                          Use Sun’s GlassFish v2 or v3 gem




vrijdag 7 november 2008                                       29
GlassFish
                            HTTP         HTTP              HTTP
                          Listener     Listener          Listener

                                     Servlet Bridge



                           Rails         Rails            Rails

                           JRuby         JRuby            JRuby
                                          JVM

                                                         Java      OS
                                        Key      Rails
                                                         code     Proc.




vrijdag 7 november 2008                                                   30
Voorbeelden

                  • Rails app in JRuby
                  • Swing applications from JRuby
                  • Mix Rails and Java




vrijdag 7 november 2008                             31
Praktijkvoorbeelden
      • Thoughtworks
              Mingle: mingle.thoughtworks.com

      • Oracle's Mix: mix.oracle.com
      • Sun: mediacast.sun.org
      • http://wiki.jruby.org/wiki/Success_Stories



vrijdag 7 november 2008                              32
Conclusie
             JRuby gebruiken voor:

             • Ontwikkelen van JRuby on Rails apps
             • Deployen van (J)Ruby on Rails apps
             • Mix van Java / Ruby
             • Swing applicaties



vrijdag 7 november 2008                              33
Vragen?


vrijdag 7 november 2008             34
Bronnen / Links (1)

   • http://wiki.jruby.org/wiki/JRuby_on_Rails_in_GlassFish
   • http://developers.sun.com/appserver/reference/techart/rails_gf
   • http://made-of-stone.blogspot.com/2006/07/why-you-should-use-
           ruby-on-rails.html

   • http://java.sun.com/developer/technicalArticles/scripting/jruby/
   • http://www.nedforce.nl/nieuws/2008/06/12/jruby-ondersteund-
           door-nedforce/

   • http://tim.lossen.de/2007/03/jruby/


vrijdag 7 november 2008                                                 35
Bronnen / Links (2)

   • http://www.ics.muni.cz/~makub/ruby/
   • http://blogs.sun.com/whacko/entry/grizzilicious_ror_on_glassfish
   • http://squaremasher.blogspot.com/2008/02/spring-ioc-in-jruby-
           life-outside.html




vrijdag 7 november 2008                                                 36

More Related Content

Featured

How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthThinkNow
 
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfAI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfmarketingartwork
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024Neil Kimberley
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)contently
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024Albert Qian
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsKurio // The Social Media Age(ncy)
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Search Engine Journal
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summarySpeakerHub
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next Tessa Mero
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentLily Ray
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best PracticesVit Horky
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project managementMindGenius
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...RachelPearson36
 
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Applitools
 
12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at WorkGetSmarter
 

Featured (20)

How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental Health
 
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfAI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
 
Skeleton Culture Code
Skeleton Culture CodeSkeleton Culture Code
Skeleton Culture Code
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search Intent
 
How to have difficult conversations
How to have difficult conversations How to have difficult conversations
How to have difficult conversations
 
Introduction to Data Science
Introduction to Data ScienceIntroduction to Data Science
Introduction to Data Science
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best Practices
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project management
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
 
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
 
12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work
 
ChatGPT webinar slides
ChatGPT webinar slidesChatGPT webinar slides
ChatGPT webinar slides
 

JRuby is het antwoord..., maar op welke vraag?

  • 1. JRuby
is
het
antwoord... maar
op
welke
vraag? Koos
de
Wit Wisdom
Ordina 6
november
2008 1 vrijdag 7 november 2008 1
  • 2. Inhoudsopgave 1. IntroducDe 2. Wat? 3. Waarom? 4. Hoe? 5. Voorbeelden 6. Conclusie 7. Vragen 2 vrijdag 7 november 2008 2
  • 3. Introductie • Werkzaam in ICT sinds 1990 • Per 1 september 2007 bij Wisdom Ordina • Software ontwikkeling en docent informatica • Sinds 1998 Javaan • Sinds 2006 Ruby on Rails vrijdag 7 november 2008 3
  • 4. Wat is JRuby? vrijdag 7 november 2008 4
  • 5. Wat is Ruby? • Programmeertaal • Ontwikkeld in 1993 • Door Yukihiro Matsumoto • Objectgeörienteerd • Geïnterpreteerd • Dynamisch vrijdag 7 november 2008 5
  • 6. Wat is Ruby? (2) • Geschreven in C • Ook wel Matz’ Ruby genoemd (naar Yukihiro Matsumoto) • http://www.ruby-lang.org • Versie 1.8.6/7 vrijdag 7 november 2008 6
  • 7. Ruby on Rails • Webapplication framework • 2004 • David Heinemeijer Hanson • Principes: • Convention over configuration • Don’t Repeat Yourself vrijdag 7 november 2008 7
  • 8. Ruby on Rails • Snelle ontwikkeling / geen compilatieslag • Model-View-Controller • ActiveRecord / Migraties • Web 2.0 / Ajax integratie • Ondersteuning voor testen vrijdag 7 november 2008 8
  • 9. Wat is JRuby? vrijdag 7 november 2008 9
  • 10. JRuby == Ruby vrijdag 7 november 2008 10
  • 11. Wat is JRuby? • Ruby implementatie in de Java VM • Compatibel met Ruby 1.8.6 • Compatibility d.m.v. testen • Ruby spec site: http://spec.ruby-doc.org • Laatste JRuby versie is 1.1.5 http://www.jruby.org vrijdag 7 november 2008 11
  • 12. Sun op J-Fall 2006 vrijdag 7 november 2008 12
  • 13. Java Platform Java Ruby JVM Python JVM Java ECMAScript PHP API API Copyright(C) 2008 Sun Microsystems, Inc. 4 vrijdag 7 november 2008 13
  • 14. Maar ... JRuby ≠ Ruby vrijdag 7 november 2008 14
  • 15. JRuby ≠ Ruby • Native threaded • No Native quot;Cquot; extentions • Java extentions for ActiveRecord-JDBC RMagick4J Mongrel • No Continuations vrijdag 7 november 2008 15
  • 16. Wat kun je met JRuby? • Execute Ruby code in de JVM • Access Java classes vanuit Ruby • Access Ruby classes vanuit Java vrijdag 7 november 2008 16
  • 18. Waarom? Twee invalshoeken: • Vanuit de commercie • Vanuit de techniek vrijdag 7 november 2008 18
  • 19. Vanuit de commercie • Opleveren wat de klant nodig heeft i.p.v. wat de klant wil hebben • Snellere time-to-market • Manier om hierop aan te sluiten: Agile development / SCRUM vrijdag 7 november 2008 19
  • 22. Vanuit de commercie • Opleveren wat de klant nodig heeft i.p.v. wat de klant wil hebben • Snellere time-to-market • Manier om hierop aan te sluiten: Agile development / SCRUM • Tools om hierop aan te sluiten vrijdag 7 november 2008 22
  • 23. Vanuit de techniek • (J)Ruby on Rails voor agile projecten • Java is voorgeschreven vanuit de klant vrijdag 7 november 2008 23
  • 24. Vanuit de techniek • Gebruik van Java VM: • Java Virtual Machine is stabiel en snel • JVM is op veel platformen beschikbaar • Bekende deployment en tuning • Minder “politieke” weerstand • JRuby is sneller dan Ruby (volgens Sun) vrijdag 7 november 2008 24
  • 25. Charles Nutter op RubyEnRails 2008: “If JRuby is slower than Ruby, file a bug” vrijdag 7 november 2008 25
  • 27. Hoe? • Download en unzip jruby.zip • Add JRuby.jar to the classpath • Install gems (libraries) such as Rails • Use command line tools like IRB, rake, etc. vrijdag 7 november 2008 27
  • 28. Hoe? • Ontwikkelen en deployen van (J)Ruby on Rails webapplicaties • Swing applicaties • Mix van Java en Ruby (obv scriptengines) vrijdag 7 november 2008 28
  • 29. Hoe? Deploy Rails applicatie • via WAR-file Genereer WAR-file met warbler gem gebaseerd op JRuby-Rack • via Directory based deploy Use Sun’s GlassFish v2 or v3 gem vrijdag 7 november 2008 29
  • 30. GlassFish HTTP HTTP HTTP Listener Listener Listener Servlet Bridge Rails Rails Rails JRuby JRuby JRuby JVM Java OS Key Rails code Proc. vrijdag 7 november 2008 30
  • 31. Voorbeelden • Rails app in JRuby • Swing applications from JRuby • Mix Rails and Java vrijdag 7 november 2008 31
  • 32. Praktijkvoorbeelden • Thoughtworks Mingle: mingle.thoughtworks.com • Oracle's Mix: mix.oracle.com • Sun: mediacast.sun.org • http://wiki.jruby.org/wiki/Success_Stories vrijdag 7 november 2008 32
  • 33. Conclusie JRuby gebruiken voor: • Ontwikkelen van JRuby on Rails apps • Deployen van (J)Ruby on Rails apps • Mix van Java / Ruby • Swing applicaties vrijdag 7 november 2008 33
  • 35. Bronnen / Links (1) • http://wiki.jruby.org/wiki/JRuby_on_Rails_in_GlassFish • http://developers.sun.com/appserver/reference/techart/rails_gf • http://made-of-stone.blogspot.com/2006/07/why-you-should-use- ruby-on-rails.html • http://java.sun.com/developer/technicalArticles/scripting/jruby/ • http://www.nedforce.nl/nieuws/2008/06/12/jruby-ondersteund- door-nedforce/ • http://tim.lossen.de/2007/03/jruby/ vrijdag 7 november 2008 35
  • 36. Bronnen / Links (2) • http://www.ics.muni.cz/~makub/ruby/ • http://blogs.sun.com/whacko/entry/grizzilicious_ror_on_glassfish • http://squaremasher.blogspot.com/2008/02/spring-ioc-in-jruby- life-outside.html vrijdag 7 november 2008 36