JRuby in a Java World
Upcoming SlideShare
Loading in...5

JRuby in a Java World



Brief overview of using JRuby in a Java shop. Covers

Brief overview of using JRuby in a Java shop. Covers



Total Views
Views on SlideShare
Embed Views



3 Embeds 9

http://www.slideshare.net 6
http://www.linkedin.com 2
https://www.linkedin.com 1



Upload Details

Uploaded via as Microsoft PowerPoint

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
Post Comment
Edit your comment

JRuby in a Java World JRuby in a Java World Presentation Transcript

  • JRuby in a Java World Sneaking JRuby in the Backdoor by Mark Menard, 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.
  • 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.
    View slide
  • 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
    View slide
  • JRuby in a Java House
    • Prototyping
    • Testing
    • Intranet Applications
    • CRUD
    • Script Existing Java Resources
  • 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
  • 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.
  • 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.
  • 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.