SlideShare a Scribd company logo
1 of 32
Download to read offline
JRuby
    Enterprise 2.0



James Crisp   Josh Price

    ThoughtWorks
Agenda

• What are Ruby and JRuby?
• Benefits and Drawbacks
• Where to use?
• Demos
• Case studies
Ruby
• Created by Yukihiro Matsumoto in 1993
• Open Source
• Vibrant community
• Dynamically typed
• Pure OO
• Syntactically flexible for DSLs
• Advanced meta programming
Ruby Runtimes
•   MRI Matz’s Ruby Interpreter in C (Ruby 1.8.6)

•   YARV Yet another Ruby VM (Ruby 1.9)

•   IronRuby .NET, DLR (alpha)

•   Rubinius Alternative VM

•   xRuby Compiler in Java

•   JRuby on the JVM
Java platform
Today’s Java Platform
JRuby

•   Java implementation of Ruby

•   Open Source

•   Full time developers from Sun and ThoughtWorks
    •   Charles Nutter, Thomas Enebo, Ola Bini et al

•   Allows Ruby to call Java code and vice versa
Timeline

•   Started around 2001 by Jan Arne Petersen

•   JRuby 1.0 released in June 2007

•   JRuby 1.1 RC2 just released

•   1.1 release out soon
Why JRuby?

•   Ruby / Rails productivity & tools
•   Java libraries and interoperability
•   Run on any OS / JVM / App server
•   Leverage existing infrastructure & ops skills
•   Politics – it's just a WAR
JRuby advantages

•   Native vs Green Threading
•   World class garbage collection
•   Unicode
•   Runs the same on all platforms
•   JIT & AOT compilation
JRuby disadvantages

• Large memory footprint
• Longer startup times
• No native C extensions
• Not technically complete
Ruby Demo
A Simple Ruby Class
class RubyDemo < Demo

   def say_hello

   
   5.times { puts “Hi from Ruby!” }

   end

   def greet(guests)

   
   guests.collect { |g| “Welcome #{g.name}” }

   end
end

>> RubyDemo.new.greet(josh, james)

=> [“Welcome Josh”, “Welcome James”]
Swing Demo
import javax.swing.JFrame
import javax.swing.JButton


f = JFrame.new('Swing Demo')
f.set_size 300, 300
f.layout = java.awt.FlowLayout.new
button = JButton.new('Hi World!')
f.add(button)
f.show
Cheri Swing Demo
require 'cheri/swing'
include Cheri::Swing
f = swing.frame('Hello') {

 size 500, 500

 flow_layout

 button('Hello!') {

 
 on_click { puts 'Hi from Swing!' }

 }
}
Rails
•   Originally written by DHH extracted from Basecamp
•   Released as Open Source in 2004
•   Complete web framework:
    •   MVC framework with built-in REST / AJAX support

    •   O-R mapping framework

    •   Standard directory structure

    •   Simple templating language for views

    •   Plug-in framework
JRuby on Rails demo
• GoldSpike
 •   Packages a WAR for any Java app server

 •   Automatically creates extra runtimes

• Warbler
 •   Easy to use wrapper around GoldSpike

• Glassfish Rails gem
 •   Gem containing Glassfish v3 and Grizzly
Where to use?

• Enterprise Glue
• Web 1.0 / 2.0 Apps
• Ruby tools for Java
JRuby as
      Enterprise Glue
• Aggregating, synchronising and displaying
  data from different systems
• Productivity benefits of using Ruby / Rails
• Leverage existing Java code
• Better JMS integration
• Best of both worlds
Case Study
•   Enterprise glue in a large investment bank

•   Different systems with partial information

•   JRuby webapp aggregates and displays data

•   Built in 4 months

•   Connects to different systems
      JDBC (Sybase, Oracle)
      XML over HTTPS (Ruby + Java)
      REST over HTTPS (Ruby + Java)
      SOAP (xFire)
Mingle
•   ThoughtWorks Studios first product
•   Agile Project Management application
•   Built with Ruby on Rails, deployed on JRuby
•   v1.0 built in < 1 year
•   v1.1 released 3 months later
•   v2.0 due for release soon
JRuby and Mingle
•   Developed in MRI deployed on JRuby

•   Stable deployment

•   Speed of development

•   Java libraries
    •   charting, search, PDF, encryption

•   Obfuscating ruby code

•   Large memory footprint / speed
Ruby Tools
• Gems package management
 • Simple
     gem install activescaffold
• Rake tool
 • Build
     rake db:migrate
• Capistrano
 • Flexible deployment tool
     cap production deploy
Rake
desc “Generate application code”
task :code_gen do
 # do the code generation
end

desc “Compile code”
task :compile => [:code_gen] do
 #do the compilation
end

desc “Test application”
task :test => [:compile] do
 # run the tests
end
Capistrano
desc quot;Start ferret serverquot;
task :start, :role => :app do
  run quot;cd #{current_path}; script/ferret_server -e #{stage} startquot;
end

desc quot;Stop ferret serverquot;
task :stop, :role => :app do
  run quot;cd #{current_path}; script/ferret_server -e #{stage} stopquot;
end

desc quot;Restart ferret serverquot;
task :restart, :role => :app do
  ferret.server.stop
  sleep(5)
  ferret.server.start
end
Unit test Java code
require 'test/unit'
require 'java'

import java.util.ArrayList

class ArrayListTest < Test::Unit::TestCase

 def test_adding_object_to_arraylist
  list = ArrayList.new
  list.add(“element”)
  assert_equal(1, list.size)
 end

end
RSpec Java code
require 'spec'
require 'java'

import java.util.ArrayList

describe quot;ArrayList with no elementsquot; do

 it quot;should have one element after adding a stringquot; do
   list = ArrayList.new
   list.add(“element”)
   list.size.should == 1
 end

end
Adoption issues

• Few developers in the market
• Smaller community than Ruby or Java
• Less books, google hits, documentation
• Less training and support options
• Diverging from the “one true language”
Adoption

 •   Ola's book
 •   Growing community
 •   Mailing lists & blogs
Summary
• Ruby / Rails productivity
• Web apps and system integration
• Leverage your Java investment
• Deploy to mature Java production
  environment
• Already used in production
Questions?
References
JRuby
  
   http://www.jruby.org
Ola Bini's blog & book
      http://ola-bini.blogspot.com/
Charles Nutter's blog
  
   http://headius.blogspot.com/
James' blog (for slides)
  
   http://jamescrisp.org/

More Related Content

What's hot

Node.js in a heterogeneous system
Node.js in a heterogeneous systemNode.js in a heterogeneous system
Node.js in a heterogeneous systemGeeksLab Odessa
 
Gate of Agile Web Development
Gate of Agile Web DevelopmentGate of Agile Web Development
Gate of Agile Web DevelopmentKoichi ITO
 
Essential debugging php debugging techniques, tips & tricks
Essential debugging php debugging techniques, tips & tricksEssential debugging php debugging techniques, tips & tricks
Essential debugging php debugging techniques, tips & tricksKaloyan Raev
 
NodeJS: n00b no more
NodeJS: n00b no moreNodeJS: n00b no more
NodeJS: n00b no moreBen Peachey
 
Gemification for Ruby 2.5/3.0
Gemification for Ruby 2.5/3.0Gemification for Ruby 2.5/3.0
Gemification for Ruby 2.5/3.0Hiroshi SHIBATA
 
Continuous Integration for front-end JavaScript
Continuous Integration for front-end JavaScriptContinuous Integration for front-end JavaScript
Continuous Integration for front-end JavaScriptLars Thorup
 
Kraken js at paypal
Kraken js at paypalKraken js at paypal
Kraken js at paypalLenny Markus
 
Javascript Bundling and modularization
Javascript Bundling and modularizationJavascript Bundling and modularization
Javascript Bundling and modularizationstbaechler
 
TorqueBox: The beauty of Ruby with the power of JBoss. Presented at Devnexus...
TorqueBox: The beauty of Ruby with the power of JBoss.  Presented at Devnexus...TorqueBox: The beauty of Ruby with the power of JBoss.  Presented at Devnexus...
TorqueBox: The beauty of Ruby with the power of JBoss. Presented at Devnexus...bobmcwhirter
 
TorqueBox at DC:JBUG - November 2011
TorqueBox at DC:JBUG - November 2011TorqueBox at DC:JBUG - November 2011
TorqueBox at DC:JBUG - November 2011bobmcwhirter
 
Performance tips for Symfony2 & PHP
Performance tips for Symfony2 & PHPPerformance tips for Symfony2 & PHP
Performance tips for Symfony2 & PHPMax Romanovsky
 
React Native in Production
React Native in ProductionReact Native in Production
React Native in ProductionSeokjun Kim
 
System webpack-jspm
System webpack-jspmSystem webpack-jspm
System webpack-jspmJesse Warden
 
TorqueBox for Rubyists
TorqueBox for RubyistsTorqueBox for Rubyists
TorqueBox for Rubyistsbobmcwhirter
 
Gearman and CodeIgniter
Gearman and CodeIgniterGearman and CodeIgniter
Gearman and CodeIgniterErik Giberti
 

What's hot (20)

JavaFX Overview
JavaFX OverviewJavaFX Overview
JavaFX Overview
 
Devignition 2011
Devignition 2011Devignition 2011
Devignition 2011
 
Node.js in a heterogeneous system
Node.js in a heterogeneous systemNode.js in a heterogeneous system
Node.js in a heterogeneous system
 
Gate of Agile Web Development
Gate of Agile Web DevelopmentGate of Agile Web Development
Gate of Agile Web Development
 
Essential debugging php debugging techniques, tips & tricks
Essential debugging php debugging techniques, tips & tricksEssential debugging php debugging techniques, tips & tricks
Essential debugging php debugging techniques, tips & tricks
 
NodeJS: n00b no more
NodeJS: n00b no moreNodeJS: n00b no more
NodeJS: n00b no more
 
Gemification for Ruby 2.5/3.0
Gemification for Ruby 2.5/3.0Gemification for Ruby 2.5/3.0
Gemification for Ruby 2.5/3.0
 
Angular2 ecosystem
Angular2 ecosystemAngular2 ecosystem
Angular2 ecosystem
 
Continuous Integration for front-end JavaScript
Continuous Integration for front-end JavaScriptContinuous Integration for front-end JavaScript
Continuous Integration for front-end JavaScript
 
Kraken js at paypal
Kraken js at paypalKraken js at paypal
Kraken js at paypal
 
Javascript Bundling and modularization
Javascript Bundling and modularizationJavascript Bundling and modularization
Javascript Bundling and modularization
 
TorqueBox: The beauty of Ruby with the power of JBoss. Presented at Devnexus...
TorqueBox: The beauty of Ruby with the power of JBoss.  Presented at Devnexus...TorqueBox: The beauty of Ruby with the power of JBoss.  Presented at Devnexus...
TorqueBox: The beauty of Ruby with the power of JBoss. Presented at Devnexus...
 
TorqueBox at DC:JBUG - November 2011
TorqueBox at DC:JBUG - November 2011TorqueBox at DC:JBUG - November 2011
TorqueBox at DC:JBUG - November 2011
 
Performance tips for Symfony2 & PHP
Performance tips for Symfony2 & PHPPerformance tips for Symfony2 & PHP
Performance tips for Symfony2 & PHP
 
Taming AEM deployments
Taming AEM deploymentsTaming AEM deployments
Taming AEM deployments
 
React Native in Production
React Native in ProductionReact Native in Production
React Native in Production
 
System webpack-jspm
System webpack-jspmSystem webpack-jspm
System webpack-jspm
 
TorqueBox for Rubyists
TorqueBox for RubyistsTorqueBox for Rubyists
TorqueBox for Rubyists
 
Gearman and CodeIgniter
Gearman and CodeIgniterGearman and CodeIgniter
Gearman and CodeIgniter
 
Everything as a code
Everything as a codeEverything as a code
Everything as a code
 

Viewers also liked

Viewers also liked (7)

Desastre Natural
Desastre NaturalDesastre Natural
Desastre Natural
 
Web 2.0 in the classroom
Web 2.0 in the classroomWeb 2.0 in the classroom
Web 2.0 in the classroom
 
Personal Learning Networks
Personal Learning NetworksPersonal Learning Networks
Personal Learning Networks
 
Já Aconteceu!!!!
Já Aconteceu!!!!Já Aconteceu!!!!
Já Aconteceu!!!!
 
Personal Learning Networks
Personal Learning NetworksPersonal Learning Networks
Personal Learning Networks
 
Fds N25 29 Fev2008
Fds N25 29 Fev2008Fds N25 29 Fev2008
Fds N25 29 Fev2008
 
CCSD Wando Middle College storyboard
CCSD Wando Middle College storyboardCCSD Wando Middle College storyboard
CCSD Wando Middle College storyboard
 

Similar to JRuby - Enterprise 2.0

JRoR Deploying Rails on JRuby
JRoR Deploying Rails on JRubyJRoR Deploying Rails on JRuby
JRoR Deploying Rails on JRubyelliando dias
 
Jruby synergy-of-ruby-and-java
Jruby synergy-of-ruby-and-javaJruby synergy-of-ruby-and-java
Jruby synergy-of-ruby-and-javaKeith Bennett
 
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 RubyAnis Ahmad
 
J Ruby Power On The Jvm
J Ruby Power On The JvmJ Ruby Power On The Jvm
J Ruby Power On The JvmQConLondon2008
 
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 Jvmdeimos
 
Bitter Java, Sweeten with JRuby
Bitter Java, Sweeten with JRubyBitter Java, Sweeten with JRuby
Bitter Java, Sweeten with JRubyBrian Sam-Bodden
 
Fast, concurrent ruby web applications with EventMachine and EM::Synchrony
Fast, concurrent ruby web applications with EventMachine and EM::SynchronyFast, concurrent ruby web applications with EventMachine and EM::Synchrony
Fast, concurrent ruby web applications with EventMachine and EM::SynchronyKyle Drake
 
Ruby on Rails survival guide of an aged Java developer
Ruby on Rails survival guide of an aged Java developerRuby on Rails survival guide of an aged Java developer
Ruby on Rails survival guide of an aged Java developergicappa
 
Quick Intro To JRuby
Quick Intro To JRubyQuick Intro To JRuby
Quick Intro To JRubyFrederic Jean
 
JRuby - Java version of Ruby
JRuby - Java version of RubyJRuby - Java version of Ruby
JRuby - Java version of RubyUday Bhaskar
 
EuRuKo JRuby Talk 2008
EuRuKo JRuby Talk 2008EuRuKo JRuby Talk 2008
EuRuKo JRuby Talk 2008geraldbauer
 
The Enterprise Strikes Back
The Enterprise Strikes BackThe Enterprise Strikes Back
The Enterprise Strikes BackBurke Libbey
 
Практики применения JRuby
Практики применения JRubyПрактики применения JRuby
Практики применения JRuby.toster
 
Introduction to JRuby
Introduction to JRubyIntroduction to JRuby
Introduction to JRubyAmit Solanki
 
J Ruby Whirlwind Tour
J Ruby Whirlwind TourJ Ruby Whirlwind Tour
J Ruby Whirlwind Touroscon2007
 
General Assembly Workshop: Advanced JavaScript
General Assembly Workshop: Advanced JavaScriptGeneral Assembly Workshop: Advanced JavaScript
General Assembly Workshop: Advanced JavaScriptSpike Brehm
 
Ruby on Rails 101 - Presentation Slides for a Five Day Introductory Course
Ruby on Rails 101 - Presentation Slides for a Five Day Introductory CourseRuby on Rails 101 - Presentation Slides for a Five Day Introductory Course
Ruby on Rails 101 - Presentation Slides for a Five Day Introductory Coursepeter_marklund
 

Similar to JRuby - Enterprise 2.0 (20)

Ugo Cei Presentation
Ugo Cei PresentationUgo Cei Presentation
Ugo Cei Presentation
 
JRoR Deploying Rails on JRuby
JRoR Deploying Rails on JRubyJRoR Deploying Rails on JRuby
JRoR Deploying Rails on JRuby
 
Jruby synergy-of-ruby-and-java
Jruby synergy-of-ruby-and-javaJruby synergy-of-ruby-and-java
Jruby synergy-of-ruby-and-java
 
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
 
J Ruby Power On The Jvm
J Ruby Power On The JvmJ Ruby Power On The Jvm
J Ruby Power On The Jvm
 
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
 
Bitter Java, Sweeten with JRuby
Bitter Java, Sweeten with JRubyBitter Java, Sweeten with JRuby
Bitter Java, Sweeten with JRuby
 
JRuby Basics
JRuby BasicsJRuby Basics
JRuby Basics
 
Fast, concurrent ruby web applications with EventMachine and EM::Synchrony
Fast, concurrent ruby web applications with EventMachine and EM::SynchronyFast, concurrent ruby web applications with EventMachine and EM::Synchrony
Fast, concurrent ruby web applications with EventMachine and EM::Synchrony
 
Ruby on Rails survival guide of an aged Java developer
Ruby on Rails survival guide of an aged Java developerRuby on Rails survival guide of an aged Java developer
Ruby on Rails survival guide of an aged Java developer
 
Quick Intro To JRuby
Quick Intro To JRubyQuick Intro To JRuby
Quick Intro To JRuby
 
JRuby - Java version of Ruby
JRuby - Java version of RubyJRuby - Java version of Ruby
JRuby - Java version of Ruby
 
EuRuKo JRuby Talk 2008
EuRuKo JRuby Talk 2008EuRuKo JRuby Talk 2008
EuRuKo JRuby Talk 2008
 
The Enterprise Strikes Back
The Enterprise Strikes BackThe Enterprise Strikes Back
The Enterprise Strikes Back
 
Практики применения JRuby
Практики применения JRubyПрактики применения JRuby
Практики применения JRuby
 
Introduction to JRuby
Introduction to JRubyIntroduction to JRuby
Introduction to JRuby
 
J Ruby Whirlwind Tour
J Ruby Whirlwind TourJ Ruby Whirlwind Tour
J Ruby Whirlwind Tour
 
General Assembly Workshop: Advanced JavaScript
General Assembly Workshop: Advanced JavaScriptGeneral Assembly Workshop: Advanced JavaScript
General Assembly Workshop: Advanced JavaScript
 
Intro to J Ruby
Intro to J RubyIntro to J Ruby
Intro to J Ruby
 
Ruby on Rails 101 - Presentation Slides for a Five Day Introductory Course
Ruby on Rails 101 - Presentation Slides for a Five Day Introductory CourseRuby on Rails 101 - Presentation Slides for a Five Day Introductory Course
Ruby on Rails 101 - Presentation Slides for a Five Day Introductory Course
 

More from Jan Sifra

Marketing na internete berú firmy vážne
Marketing na internete berú firmy vážneMarketing na internete berú firmy vážne
Marketing na internete berú firmy vážneJan Sifra
 
Pátranie po reklamnej agentúre Tomáša Baťu
Pátranie po reklamnej agentúre Tomáša BaťuPátranie po reklamnej agentúre Tomáša Baťu
Pátranie po reklamnej agentúre Tomáša BaťuJan Sifra
 
15 vecí, ktoré som mal vedieť ako študent marketingu
15 vecí, ktoré som mal vedieť ako študent marketingu15 vecí, ktoré som mal vedieť ako študent marketingu
15 vecí, ktoré som mal vedieť ako študent marketinguJan Sifra
 
Baťa brožúra z 30. rokov
Baťa brožúra z 30. rokovBaťa brožúra z 30. rokov
Baťa brožúra z 30. rokovJan Sifra
 
Time manažment ohlupovacou metódou
Time manažment ohlupovacou metódouTime manažment ohlupovacou metódou
Time manažment ohlupovacou metódouJan Sifra
 
15 vecí, ktoré by ste mali vedieť o písaní reklamných titulkov pre web
15 vecí, ktoré by ste mali vedieť o písaní reklamných titulkov pre web15 vecí, ktoré by ste mali vedieť o písaní reklamných titulkov pre web
15 vecí, ktoré by ste mali vedieť o písaní reklamných titulkov pre webJan Sifra
 
Etarget Partner programme - Bulgaria
Etarget Partner programme - BulgariaEtarget Partner programme - Bulgaria
Etarget Partner programme - BulgariaJan Sifra
 
3 lessons science can teach you about internet marketing
3 lessons science can teach you about internet marketing3 lessons science can teach you about internet marketing
3 lessons science can teach you about internet marketingJan Sifra
 
Strategie Social Net
Strategie Social NetStrategie Social Net
Strategie Social NetJan Sifra
 
Nokia for Business
Nokia for BusinessNokia for Business
Nokia for BusinessJan Sifra
 
Jak zvýšit mobilitu firemních pracovníků - Mobile Nokia Intellisync software
Jak zvýšit mobilitu firemních pracovníků - Mobile Nokia Intellisync softwareJak zvýšit mobilitu firemních pracovníků - Mobile Nokia Intellisync software
Jak zvýšit mobilitu firemních pracovníků - Mobile Nokia Intellisync softwareJan Sifra
 
Nasazení mobilních technologií v českých podnicích
Nasazení mobilních technologií v českých podnicích Nasazení mobilních technologií v českých podnicích
Nasazení mobilních technologií v českých podnicích Jan Sifra
 
Koppl Internet
Koppl InternetKoppl Internet
Koppl InternetJan Sifra
 
How to keep sales up with Etarget
How to keep sales up with EtargetHow to keep sales up with Etarget
How to keep sales up with EtargetJan Sifra
 
Advertising Exchanges - Open the market!
Advertising Exchanges - Open the market!Advertising Exchanges - Open the market!
Advertising Exchanges - Open the market!Jan Sifra
 
Futurad Case Studies
Futurad Case StudiesFuturad Case Studies
Futurad Case StudiesJan Sifra
 
Reality Mining (Nathan Eagle)
Reality Mining (Nathan Eagle)Reality Mining (Nathan Eagle)
Reality Mining (Nathan Eagle)Jan Sifra
 
I'm sorry Jaiku, I have been drunk since Thursday. Pictures on myspace
I'm sorry Jaiku, I have been drunk since Thursday. Pictures on myspaceI'm sorry Jaiku, I have been drunk since Thursday. Pictures on myspace
I'm sorry Jaiku, I have been drunk since Thursday. Pictures on myspaceJan Sifra
 
Dnes k vam pride navsteva
Dnes k vam pride navstevaDnes k vam pride navsteva
Dnes k vam pride navstevaJan Sifra
 
Serban Alexandrescu
Serban AlexandrescuSerban Alexandrescu
Serban AlexandrescuJan Sifra
 

More from Jan Sifra (20)

Marketing na internete berú firmy vážne
Marketing na internete berú firmy vážneMarketing na internete berú firmy vážne
Marketing na internete berú firmy vážne
 
Pátranie po reklamnej agentúre Tomáša Baťu
Pátranie po reklamnej agentúre Tomáša BaťuPátranie po reklamnej agentúre Tomáša Baťu
Pátranie po reklamnej agentúre Tomáša Baťu
 
15 vecí, ktoré som mal vedieť ako študent marketingu
15 vecí, ktoré som mal vedieť ako študent marketingu15 vecí, ktoré som mal vedieť ako študent marketingu
15 vecí, ktoré som mal vedieť ako študent marketingu
 
Baťa brožúra z 30. rokov
Baťa brožúra z 30. rokovBaťa brožúra z 30. rokov
Baťa brožúra z 30. rokov
 
Time manažment ohlupovacou metódou
Time manažment ohlupovacou metódouTime manažment ohlupovacou metódou
Time manažment ohlupovacou metódou
 
15 vecí, ktoré by ste mali vedieť o písaní reklamných titulkov pre web
15 vecí, ktoré by ste mali vedieť o písaní reklamných titulkov pre web15 vecí, ktoré by ste mali vedieť o písaní reklamných titulkov pre web
15 vecí, ktoré by ste mali vedieť o písaní reklamných titulkov pre web
 
Etarget Partner programme - Bulgaria
Etarget Partner programme - BulgariaEtarget Partner programme - Bulgaria
Etarget Partner programme - Bulgaria
 
3 lessons science can teach you about internet marketing
3 lessons science can teach you about internet marketing3 lessons science can teach you about internet marketing
3 lessons science can teach you about internet marketing
 
Strategie Social Net
Strategie Social NetStrategie Social Net
Strategie Social Net
 
Nokia for Business
Nokia for BusinessNokia for Business
Nokia for Business
 
Jak zvýšit mobilitu firemních pracovníků - Mobile Nokia Intellisync software
Jak zvýšit mobilitu firemních pracovníků - Mobile Nokia Intellisync softwareJak zvýšit mobilitu firemních pracovníků - Mobile Nokia Intellisync software
Jak zvýšit mobilitu firemních pracovníků - Mobile Nokia Intellisync software
 
Nasazení mobilních technologií v českých podnicích
Nasazení mobilních technologií v českých podnicích Nasazení mobilních technologií v českých podnicích
Nasazení mobilních technologií v českých podnicích
 
Koppl Internet
Koppl InternetKoppl Internet
Koppl Internet
 
How to keep sales up with Etarget
How to keep sales up with EtargetHow to keep sales up with Etarget
How to keep sales up with Etarget
 
Advertising Exchanges - Open the market!
Advertising Exchanges - Open the market!Advertising Exchanges - Open the market!
Advertising Exchanges - Open the market!
 
Futurad Case Studies
Futurad Case StudiesFuturad Case Studies
Futurad Case Studies
 
Reality Mining (Nathan Eagle)
Reality Mining (Nathan Eagle)Reality Mining (Nathan Eagle)
Reality Mining (Nathan Eagle)
 
I'm sorry Jaiku, I have been drunk since Thursday. Pictures on myspace
I'm sorry Jaiku, I have been drunk since Thursday. Pictures on myspaceI'm sorry Jaiku, I have been drunk since Thursday. Pictures on myspace
I'm sorry Jaiku, I have been drunk since Thursday. Pictures on myspace
 
Dnes k vam pride navsteva
Dnes k vam pride navstevaDnes k vam pride navsteva
Dnes k vam pride navsteva
 
Serban Alexandrescu
Serban AlexandrescuSerban Alexandrescu
Serban Alexandrescu
 

Recently uploaded

Developing An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilDeveloping An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilV3cube
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking MenDelhi Call girls
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Drew Madelung
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsMaria Levchenko
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Allon Mureinik
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking MenDelhi Call girls
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...apidays
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountPuma Security, LLC
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfEnterprise Knowledge
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxKatpro Technologies
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024Results
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024The Digital Insurer
 

Recently uploaded (20)

Developing An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilDeveloping An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of Brazil
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 

JRuby - Enterprise 2.0

  • 1. JRuby Enterprise 2.0 James Crisp Josh Price ThoughtWorks
  • 2. Agenda • What are Ruby and JRuby? • Benefits and Drawbacks • Where to use? • Demos • Case studies
  • 3. Ruby • Created by Yukihiro Matsumoto in 1993 • Open Source • Vibrant community • Dynamically typed • Pure OO • Syntactically flexible for DSLs • Advanced meta programming
  • 4. Ruby Runtimes • MRI Matz’s Ruby Interpreter in C (Ruby 1.8.6) • YARV Yet another Ruby VM (Ruby 1.9) • IronRuby .NET, DLR (alpha) • Rubinius Alternative VM • xRuby Compiler in Java • JRuby on the JVM
  • 7. JRuby • Java implementation of Ruby • Open Source • Full time developers from Sun and ThoughtWorks • Charles Nutter, Thomas Enebo, Ola Bini et al • Allows Ruby to call Java code and vice versa
  • 8. Timeline • Started around 2001 by Jan Arne Petersen • JRuby 1.0 released in June 2007 • JRuby 1.1 RC2 just released • 1.1 release out soon
  • 9. Why JRuby? • Ruby / Rails productivity & tools • Java libraries and interoperability • Run on any OS / JVM / App server • Leverage existing infrastructure & ops skills • Politics – it's just a WAR
  • 10. JRuby advantages • Native vs Green Threading • World class garbage collection • Unicode • Runs the same on all platforms • JIT & AOT compilation
  • 11. JRuby disadvantages • Large memory footprint • Longer startup times • No native C extensions • Not technically complete
  • 13. A Simple Ruby Class class RubyDemo < Demo def say_hello 5.times { puts “Hi from Ruby!” } end def greet(guests) guests.collect { |g| “Welcome #{g.name}” } end end >> RubyDemo.new.greet(josh, james) => [“Welcome Josh”, “Welcome James”]
  • 14. Swing Demo import javax.swing.JFrame import javax.swing.JButton f = JFrame.new('Swing Demo') f.set_size 300, 300 f.layout = java.awt.FlowLayout.new button = JButton.new('Hi World!') f.add(button) f.show
  • 15. Cheri Swing Demo require 'cheri/swing' include Cheri::Swing f = swing.frame('Hello') { size 500, 500 flow_layout button('Hello!') { on_click { puts 'Hi from Swing!' } } }
  • 16. Rails • Originally written by DHH extracted from Basecamp • Released as Open Source in 2004 • Complete web framework: • MVC framework with built-in REST / AJAX support • O-R mapping framework • Standard directory structure • Simple templating language for views • Plug-in framework
  • 17. JRuby on Rails demo • GoldSpike • Packages a WAR for any Java app server • Automatically creates extra runtimes • Warbler • Easy to use wrapper around GoldSpike • Glassfish Rails gem • Gem containing Glassfish v3 and Grizzly
  • 18. Where to use? • Enterprise Glue • Web 1.0 / 2.0 Apps • Ruby tools for Java
  • 19. JRuby as Enterprise Glue • Aggregating, synchronising and displaying data from different systems • Productivity benefits of using Ruby / Rails • Leverage existing Java code • Better JMS integration • Best of both worlds
  • 20. Case Study • Enterprise glue in a large investment bank • Different systems with partial information • JRuby webapp aggregates and displays data • Built in 4 months • Connects to different systems JDBC (Sybase, Oracle) XML over HTTPS (Ruby + Java) REST over HTTPS (Ruby + Java) SOAP (xFire)
  • 21. Mingle • ThoughtWorks Studios first product • Agile Project Management application • Built with Ruby on Rails, deployed on JRuby • v1.0 built in < 1 year • v1.1 released 3 months later • v2.0 due for release soon
  • 22. JRuby and Mingle • Developed in MRI deployed on JRuby • Stable deployment • Speed of development • Java libraries • charting, search, PDF, encryption • Obfuscating ruby code • Large memory footprint / speed
  • 23. Ruby Tools • Gems package management • Simple gem install activescaffold • Rake tool • Build rake db:migrate • Capistrano • Flexible deployment tool cap production deploy
  • 24. Rake desc “Generate application code” task :code_gen do # do the code generation end desc “Compile code” task :compile => [:code_gen] do #do the compilation end desc “Test application” task :test => [:compile] do # run the tests end
  • 25. Capistrano desc quot;Start ferret serverquot; task :start, :role => :app do run quot;cd #{current_path}; script/ferret_server -e #{stage} startquot; end desc quot;Stop ferret serverquot; task :stop, :role => :app do run quot;cd #{current_path}; script/ferret_server -e #{stage} stopquot; end desc quot;Restart ferret serverquot; task :restart, :role => :app do ferret.server.stop sleep(5) ferret.server.start end
  • 26. Unit test Java code require 'test/unit' require 'java' import java.util.ArrayList class ArrayListTest < Test::Unit::TestCase def test_adding_object_to_arraylist list = ArrayList.new list.add(“element”) assert_equal(1, list.size) end end
  • 27. RSpec Java code require 'spec' require 'java' import java.util.ArrayList describe quot;ArrayList with no elementsquot; do it quot;should have one element after adding a stringquot; do list = ArrayList.new list.add(“element”) list.size.should == 1 end end
  • 28. Adoption issues • Few developers in the market • Smaller community than Ruby or Java • Less books, google hits, documentation • Less training and support options • Diverging from the “one true language”
  • 29. Adoption • Ola's book • Growing community • Mailing lists & blogs
  • 30. Summary • Ruby / Rails productivity • Web apps and system integration • Leverage your Java investment • Deploy to mature Java production environment • Already used in production
  • 32. References JRuby http://www.jruby.org Ola Bini's blog & book http://ola-bini.blogspot.com/ Charles Nutter's blog http://headius.blogspot.com/ James' blog (for slides) http://jamescrisp.org/