SlideShare uma empresa Scribd logo
1 de 13
JRuby: The power of Java
              and Ruby
            - by Uday Bhaskar
                          Sr., Java Programmer
                               Olive Technology
                          uday@olivetech.com
              http://udaiibhaskar.blogspot.com
JRuby: The power of Java
                                   and Ruby
Agenda



         Introduction to Ruby

             What is JRuby

             JRuby on Rails

          JRuby on Netbeans

             Where To Go
JRuby: The power of Java
                                                         and Ruby
Introduction to Ruby


 • Created by Yukihiro “Matz” Matsumoto
    >Started around 1993, about the same time as Java


 • What is a scripting language?
    >No compilation unit
          puts “Hello world”
   >Specialized syntax
         subject.gsub(/before/, quot;afterquot;)
   >Maybe dynamic typing /duck typing

 • Design to put the “fun” back into programming
JRuby: The power of Java
                                               and Ruby
A Typical Ruby Class

 class Person

  attr_accessor :fname, :lname

  def initialize(fname, lname)
   @fname = fname
   @lname = lname
  end

  def to_s
   @lname + quot;, quot; + @fname
  end

 end
JRuby: The power of Java
                                                 and Ruby
What is Ruby on Rails

 • Main web framework for Ruby

 • Scaffolding

 • Metaprogramming

 • Convention over configuration

 • Web development that doesn’t hurt
 • High productivity
   >Less code to write
   >No deployment
   >Easy to learn
JRuby: The power of Java
                                                    and Ruby
Comparison of Rails and Struts Stack




 • Tomcat servlet container
 • Struts Web application framework
 • Hibernate persistence framework
JRuby: The power of Java
                                                   and Ruby
Ruby/Java




  • Ruby language is different from Java

  • Ruby platform is different from Java

  • How can Java developers benefit?
JRuby: The power of Java
                                                    and Ruby
What is JRuby?

 • Implementation of Ruby written in Java

 • Compatible with Ruby 1.8.6               http://jruby.codehaus.org/


 • Enables use of Java code in Ruby

 • Easier deployment

 • More libraries

 • More platforms, OpenSource

 • “Itʼs just Ruby”
JRuby: The power of Java
                                                          and Ruby
JRuby Demo


 Java:
    VoiceManager vm = VoiceManager.getInstance();
    Voice voice = vm.getVoice(quot;kevin16quot;);
    voice.allocate();
    voice.speak(jTextArea1.getText());
    voice.deallocate();

 Ruby:
    require 'java'
    vm = com.sun.speech.freetts.VoiceManager.getInstance()
    voice = vm.getVoice(quot;kevin16quot;)
    voice.allocate()
    voice.speak(quot;Calling Java code from Rubyquot;)
    voice.deallocate()
JRuby: The power of Java
                                          and Ruby
JRuby/Ruby on Rails Demo




           I am using “Netbeans IDE” for
                     this Demo
JRuby: The power of Java
                                             and Ruby
 Questions




“Good Question!” means I don’t have an answer :-)
JRuby: The power of Java
                                                    and Ruby
Where to go for Ruby information




   • Online material:
     •   http://jruby.codehaus.org/
     •   http://rubyonrails.org/
     •   Rails screencast(s)
     •   Planet Ruby on Rails
Thank You
- by Uday Bhaskar
               Sr., Java Programmer
                   Olive InfoServices
               uday@olivetech.com
   http://udaiibhaskar.blogspot.com

Mais conteúdo relacionado

Destaque

Black box testing or behavioral testing
Black box testing or behavioral testingBlack box testing or behavioral testing
Black box testing or behavioral testing
Slideshare
 

Destaque (7)

Black box testing or behavioral testing
Black box testing or behavioral testingBlack box testing or behavioral testing
Black box testing or behavioral testing
 
10 Insightful Quotes On Designing A Better Customer Experience
10 Insightful Quotes On Designing A Better Customer Experience10 Insightful Quotes On Designing A Better Customer Experience
10 Insightful Quotes On Designing A Better Customer Experience
 
How to Build a Dynamic Social Media Plan
How to Build a Dynamic Social Media PlanHow to Build a Dynamic Social Media Plan
How to Build a Dynamic Social Media Plan
 
Learn BEM: CSS Naming Convention
Learn BEM: CSS Naming ConventionLearn BEM: CSS Naming Convention
Learn BEM: CSS Naming Convention
 
SEO: Getting Personal
SEO: Getting PersonalSEO: Getting Personal
SEO: Getting Personal
 
Lightning Talk #9: How UX and Data Storytelling Can Shape Policy by Mika Aldaba
Lightning Talk #9: How UX and Data Storytelling Can Shape Policy by Mika AldabaLightning Talk #9: How UX and Data Storytelling Can Shape Policy by Mika Aldaba
Lightning Talk #9: How UX and Data Storytelling Can Shape Policy by Mika Aldaba
 
Succession “Losers”: What Happens to Executives Passed Over for the CEO Job?
Succession “Losers”: What Happens to Executives Passed Over for the CEO Job? Succession “Losers”: What Happens to Executives Passed Over for the CEO Job?
Succession “Losers”: What Happens to Executives Passed Over for the CEO Job?
 

Semelhante a JRuby - Java version of Ruby

JRuby - Enterprise 2.0
JRuby - Enterprise 2.0JRuby - Enterprise 2.0
JRuby - Enterprise 2.0
Jan Sifra
 
Ola Bini J Ruby Power On The Jvm
Ola Bini J Ruby Power On The JvmOla Bini J Ruby Power On The Jvm
Ola Bini J Ruby Power On The Jvm
deimos
 
J Ruby Power On The Jvm
J Ruby Power On The JvmJ Ruby Power On The Jvm
J Ruby Power On The Jvm
QConLondon2008
 
Jruby synergy-of-ruby-and-java
Jruby synergy-of-ruby-and-javaJruby synergy-of-ruby-and-java
Jruby synergy-of-ruby-and-java
Keith Bennett
 
J Ruby Whirlwind Tour
J Ruby Whirlwind TourJ Ruby Whirlwind Tour
J Ruby Whirlwind Tour
oscon2007
 

Semelhante a JRuby - Java version of Ruby (20)

JRuby Basics
JRuby BasicsJRuby Basics
JRuby Basics
 
Bitter Java, Sweeten with JRuby
Bitter Java, Sweeten with JRubyBitter Java, Sweeten with JRuby
Bitter Java, Sweeten with JRuby
 
JRuby - Enterprise 2.0
JRuby - Enterprise 2.0JRuby - Enterprise 2.0
JRuby - Enterprise 2.0
 
Ugo Cei Presentation
Ugo Cei PresentationUgo Cei Presentation
Ugo Cei Presentation
 
Rails On Spring
Rails On SpringRails On Spring
Rails On Spring
 
Ola Bini J Ruby Power On The Jvm
Ola Bini J Ruby Power On The JvmOla Bini J Ruby Power On The Jvm
Ola Bini J Ruby Power On The Jvm
 
JRuby in a Java World
JRuby in a Java WorldJRuby in a Java World
JRuby in a Java World
 
J Ruby Power On The Jvm
J Ruby Power On The JvmJ Ruby Power On The Jvm
J Ruby Power On The Jvm
 
Day 8 - jRuby
Day 8 - jRubyDay 8 - jRuby
Day 8 - jRuby
 
JRuby - Programmer's Best Friend on JVM
JRuby - Programmer's Best Friend on JVMJRuby - Programmer's Best Friend on JVM
JRuby - Programmer's Best Friend on JVM
 
Practical JRuby
Practical JRubyPractical JRuby
Practical JRuby
 
Jruby synergy-of-ruby-and-java
Jruby synergy-of-ruby-and-javaJruby synergy-of-ruby-and-java
Jruby synergy-of-ruby-and-java
 
JRuby - The Perfect Alternative
JRuby - The Perfect AlternativeJRuby - The Perfect Alternative
JRuby - The Perfect Alternative
 
Úvod do Ruby on Rails
Úvod do Ruby on RailsÚvod do Ruby on Rails
Úvod do Ruby on Rails
 
Developing cross platform desktop application with Ruby
Developing cross platform desktop application with RubyDeveloping cross platform desktop application with Ruby
Developing cross platform desktop application with Ruby
 
Практики применения JRuby
Практики применения JRubyПрактики применения JRuby
Практики применения JRuby
 
XRuby_Overview_20070831
XRuby_Overview_20070831XRuby_Overview_20070831
XRuby_Overview_20070831
 
The Enterprise Strikes Back
The Enterprise Strikes BackThe Enterprise Strikes Back
The Enterprise Strikes Back
 
Amoocon May 2009 Germany
Amoocon May 2009   GermanyAmoocon May 2009   Germany
Amoocon May 2009 Germany
 
J Ruby Whirlwind Tour
J Ruby Whirlwind TourJ Ruby Whirlwind Tour
J Ruby Whirlwind Tour
 

Último

Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
panagenda
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
?#DUbAI#??##{{(☎️+971_581248768%)**%*]'#abortion pills for sale in dubai@
 

Último (20)

TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptx
 
Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
Exploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusExploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with Milvus
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challenges
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfRising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
 
Six Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal OntologySix Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal Ontology
 
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
 
WSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering DevelopersWSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering Developers
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 

JRuby - Java version of Ruby

  • 1. JRuby: The power of Java and Ruby - by Uday Bhaskar Sr., Java Programmer Olive Technology uday@olivetech.com http://udaiibhaskar.blogspot.com
  • 2. JRuby: The power of Java and Ruby Agenda Introduction to Ruby What is JRuby JRuby on Rails JRuby on Netbeans Where To Go
  • 3. JRuby: The power of Java and Ruby Introduction to Ruby • Created by Yukihiro “Matz” Matsumoto >Started around 1993, about the same time as Java • What is a scripting language? >No compilation unit puts “Hello world” >Specialized syntax subject.gsub(/before/, quot;afterquot;) >Maybe dynamic typing /duck typing • Design to put the “fun” back into programming
  • 4. JRuby: The power of Java and Ruby A Typical Ruby Class class Person attr_accessor :fname, :lname def initialize(fname, lname) @fname = fname @lname = lname end def to_s @lname + quot;, quot; + @fname end end
  • 5. JRuby: The power of Java and Ruby What is Ruby on Rails • Main web framework for Ruby • Scaffolding • Metaprogramming • Convention over configuration • Web development that doesn’t hurt • High productivity >Less code to write >No deployment >Easy to learn
  • 6. JRuby: The power of Java and Ruby Comparison of Rails and Struts Stack • Tomcat servlet container • Struts Web application framework • Hibernate persistence framework
  • 7. JRuby: The power of Java and Ruby Ruby/Java • Ruby language is different from Java • Ruby platform is different from Java • How can Java developers benefit?
  • 8. JRuby: The power of Java and Ruby What is JRuby? • Implementation of Ruby written in Java • Compatible with Ruby 1.8.6 http://jruby.codehaus.org/ • Enables use of Java code in Ruby • Easier deployment • More libraries • More platforms, OpenSource • “Itʼs just Ruby”
  • 9. JRuby: The power of Java and Ruby JRuby Demo Java: VoiceManager vm = VoiceManager.getInstance(); Voice voice = vm.getVoice(quot;kevin16quot;); voice.allocate(); voice.speak(jTextArea1.getText()); voice.deallocate(); Ruby: require 'java' vm = com.sun.speech.freetts.VoiceManager.getInstance() voice = vm.getVoice(quot;kevin16quot;) voice.allocate() voice.speak(quot;Calling Java code from Rubyquot;) voice.deallocate()
  • 10. JRuby: The power of Java and Ruby JRuby/Ruby on Rails Demo I am using “Netbeans IDE” for this Demo
  • 11. JRuby: The power of Java and Ruby Questions “Good Question!” means I don’t have an answer :-)
  • 12. JRuby: The power of Java and Ruby Where to go for Ruby information • Online material: • http://jruby.codehaus.org/ • http://rubyonrails.org/ • Rails screencast(s) • Planet Ruby on Rails
  • 13. Thank You - by Uday Bhaskar Sr., Java Programmer Olive InfoServices uday@olivetech.com http://udaiibhaskar.blogspot.com