Download - JRuby in a Java World
JRuby in a Java WorldSneaking JRuby in the Backdoorby Mark Menard, Vita Rara, Inc.
© 2004 Vita Rara, Inc.
JRuby
JRuby is an implementation of Ruby that runs on the Java Virtual Machine. Can use Java classes. Supports embedding into Java applications.
Allows testing of Java code using Ruby tools such as: RSpec Cucumber
Support is coming for creating Java classes.
© 2004 Vita Rara, Inc.
JRuby for Java Developers
A dynamically typed object oriented language.
Supports open classes and meta-programming.
Terse syntax with low ceremony. High developer productivity. Has support for closures. Is focused on developer joy.
© 2004 Vita Rara, Inc.
JRuby on Rails
Ruby on Rails A highly productive Ruby web framework focusing on convention over configuration, and DRY (Don’t Repeat Yourself).
Used in many high volume Software as a Service applications. Basecamp Lighthouse App
Branching out into more consumer oriented websites. Yellowpages.com Slideshare.net
© 2004 Vita Rara, Inc.
JRuby in a Java House
Prototyping Testing Intranet Applications CRUD Script Existing Java Resources
© 2004 Vita Rara, Inc.
Language per Tier
Use appropriate language per tier of your application.
We’re all polyglots! Model
Java, Groovy++ or Scala for performance
Ruby, Groovy or Python for expressiveness
Controller Use a dynamic language
View JSP, Velocity, ERB, Groovy, Javascript
© 2004 Vita Rara, Inc.
Greenfield Development
JRuby on Rails runs on the JVM and can be deployed in most Java application servers.
Packaging is easy via Warbler gem. Consider this if you have a simple proof of concept project.
© 2004 Vita Rara, Inc.
Brownfield Development
How many greenfields are there really?
Strategies Script existing domain models. Use as scripting language for business rules.
Embed Rails app in existing Java web app.
Use Cucumber to test existing web app.
Use RSpec to test existing Java code.
© 2004 Vita Rara, Inc.
Sneaking Rails in the Backdoor
Embed a Rails app inside an existing Java web application. Add JRuby dependencies Add jruby-rack handler to web.xml Create Rails application in project. Integrate packaging of Rails app into build process. Can be in a subdirectory of /WEB-INF, or Can be integrated into the / of the web application.