We're hiring!

We're actively seeking designers and developers for all three of our locations.

Ruby for Desktop Applications? Yes we can.

Just today someone told us he heard you can’t do real development in Ruby. Funny – the AGI Goldratt Institute paid us a whole bunch of money for nothing then. It must be that their brand new, multi-platform, JRuby-based desktop simulation app doesn’t exist. Pity.

Based on our search traffic, the posts by Shawn and Matt on desktop development in JRuby are our most popular:

Now that the AGI app we couldn’t name in those previous posts is done, we can talk much more about how we put it together. The most exciting point is that Ruby can be used successfully for large-scale desktop development.

UPDATE (February 4, 2009): Added demo movie goodness provided by AGI.

Backstory

<corporate speak>AGI provides Theory of Constraints consulting and training to organizations pursuing rapid and sustained bottom line improvement</corporate speak>. They’ve been fantastic to work with, and they help their clients achieve impressive results. AGI uses several pieces of software in their training sessions to simulate manufacturing and supply chain scenarios. They’re reminiscent of old skool games. These original applications were developed for DOS in the early 90s. As time went on the simulators presented a number of pain points motivating AGI to contract out new software development – that’s where we came in.

How We Did It

We love Ruby and how much can be accomplished in a short time with it. With JRuby and 12-ish months we created for AGI a complex desktop application, Production Simulator, able to run on Windows, Mac, and Linux. The awesomeness here is that JRuby let us use a preferred language, Ruby, together with a bunch of really mature Java libraries, technologies, and tools that might not otherwise be available to Ruby. And, in the end, thanks to Java we got multi-platform support almost for free.

The application is multi-threaded to decouple simulation execution, graphical updates, and user interaction. Heavy lifting in the simulation doesn’t decrease the application’s responsiveness to the user; updating the interface doesn’t slow down the core simulation. Under the hood, simulation execution has certain similarities to a gaming engine.

  • Our normal practices ran the show – stories, iterations, whole team, burn-down charts, TDD, continuous integration, etc.
  • RSpec runs 2120 Unit tests + 286 Integration tests
  • Atomic Object libraries Hardmock, Constructor, & DIY enabled our testing and construction patterns
  • Copious use of Presenter First allowed GUI stories to be fashioned into tested code
  • Substance skins the app
  • Batik creates an SVG canvas upon which the simulation screen itself is drawn
  • Bouncy Castle encrypts the license keys and simulation files
  • YAML specifies production facility layouts, resources, and parameters
  • Two Java jars package up the whole app [HOWTO roll a JRuby desktop app]
    (one for app + libraries; another for Bouncy Castle lib due to technical complication)
  • NSIS handles installation in Windows
  • IzPack handles installation in Mac & Linux (in process of replacing with native Mac installer now)
  • Launch4J handles launching the app in Windows
  • IzPack handles launching the app in OSX
  • A shell script handles launching the app in Linux

Incidental Goodies

Because of our exposure to AGI we came across the book Agile Management for Software Engineering: Applying the Theory of Constraints for Business Results. It concerns itself with using the Theory of Constraints to explain the effectiveness of the practices we use. Interesting read.

Demo Movie

Screenshots

Note: the new app’s cropped shots here link to big beautiful full images

New Production Simulator's chrome, simulation area, & widgets

New Production Simulator’s chrome, simulation area, & widgets (full image)

New Production Simulator's Buffer Management interface

New Production Simulator’s Buffer Management interface (full image)

Original DOS-based application

Original DOS-based application

 

Matt Fletcher (76 Posts)

Matt is a software practitioner with Atomic Object.

This entry was posted in Project Stories and tagged . Bookmark the permalink. Both comments and trackbacks are currently closed.

5 Comments

  1. mark
    Posted January 30, 2009 at 7:12 pm

    Man… the DOS version beats the rest so easily…

    Haha just kidding :-)

    I still got a weak spot in my heart for DOS though.

    Anyway, that’s so long ago – go ruby, go!

  2. Rafael Rosa Fu
    Posted January 30, 2009 at 7:12 pm

    Wow!!! I’ve used the DOS simulator at college, was a lot of fun but very old and ugly :) Never been so happy to see it again :) Nice job.

    Cheers,
    Rafael.

  3. Ronald Suwandi
    Posted January 30, 2009 at 7:12 pm

    It’s awesome.. This is the first time I saw a real ruby-based desktop application. Cheers =)

  4. Posted January 30, 2009 at 7:12 pm

    Looks good.

    I’m currently developing a JRuby desktop app that uses swing and I am concerned about the high memory consumption of my app. It’s about 300M with JRuby, activerecord, a mildly complex swing view and some additional libraries.
    Did you experience similar problems and did you solve them (or just told the client to get more mem? :-)

  5. Posted January 30, 2009 at 7:12 pm

    Martin:

    We set the initial and max heap size to 512 mb. We have not had a problem with memory consumption going beyond this limit.

4 Trackbacks

  1. [...] one of our customers asked us to create a small, single-purpose tool to help support one of our JRuby desktop applications. The requirement was simple: make it easy to input minimum, maximum, and beta values into a beta [...]

  2. [...] Swing testing. We’ve been using a combination of FEST and Ruby helpers specific to our own Swing applications. As Demetrius notes, Swing tests can be frustratingly brittle, but they are still well worth the [...]

  3. By Thin Red | SOUVENIR on November 9, 2011 at 7:12 pm

    [...] actors find humble shoes can teach them lessons From Cinderella ‘s glass slippers to the ruby red shoes worn by Dorothy in Oz, footwear only rarely The Thin Red Line – Trailer – [...]

  4. [...] first engaged Atomic as a customer, trying to build a sizable software product. But I had no clue how to apply critical chain to the new environment of programming pairs, [...]