Message Driven Beans in Jruby

It was hard to find a lot of documentation on how to create a Message Driven Bean (MDB) EJB (for deployment into glassfish). Basically - I want to create a ruby app that receives messages and then does stuff with them. After tons of looking around I was able to finally put together one using NetBeans.

http://github.com/tobowers/jruby-mdb/tree/master

I don’t have time now to go into the details… I, hopefully, will soon. However, edit the TesterMessageHandlerBean.java to change what message queue it listens to. Add or edit files in the src/conf/ruby directory to add ruby files.

Hope that helps… later I’ll go into more detail about setting up glassfish and using OpenMQ.

I hate java, but this is a pretty damn nice way to deploy your ruby apps. Hopefully, this’ll be a good start into letting us have ruby apps listening to OpenMQ in glassfish, but using jRuby.

Mamoo released as open source

I just put the Motionbox Advanced Model Observer Observer (Mamoo) up on Github. It's a light-weight (13k), but fairly powerful framework for javascript built on top of Prototype and the Motionbox EventHandler.

It's fairly well documented and has a full suite of specs written in ScrewUnit.

Mamoo let's you stop thinking about the "glue code" you need on a client-side app - and start thinking like "when this happens, I want this to happen." - Event driven architecture in JS.

Checkout the readme for a romp through most of the features.

To whet your appetite, here's a really small, but useful app written with Mamoo.

JavaScript:
Message = MBX.JsModel.create("Message");

MBX.MessageView = MBX.JsView.create({
    model: Message,
   
    onInstanceCreate: function (message) {
        var li = this.buildLi(message);
        $("message_list").insert(li);
    },
   
    buildLi: function (message) {
        var li = new Element("li", { id: message.primaryKey() });
        li.update(message.get('body'));
        li.updatesOn(message, "body");
        return li;
    }
});

// This will add the ui element
var message = Message.create({ body: "this is my body!" });

// and if you change body, the ui will automatically update as well
message.set('body', "some other body");

Assuming you have an ol with the id of "message_list" in your html page, now everytime you create a message, it'll get populated into the DOM.

I also put together a 15minute screencast that gives you a quick demo of a bunch of the features of Mamoo.

Nifty?

Boxes and Arrows: Bringing Holistic Awareness to Your Design

Bringing Holistic Awareness to Your Design - Boxes and Arrows

We did not find any correlation with user satisfaction and those teams with the most specialized team members, one way or the other: some teams with the most specialization did well, and some teams did poorly. What we did consistently observe among teams that had high user satisfaction scores, was one characteristic that stood out above all the others—what we began to call shared, holistic understanding. Those teams that achieved the highest degree of shared, holistic understanding consistently designed the best web applications. The more each team member understood the business goals, the user needs, and the capabilities and limitations of the IT environment—a holistic view—the more successful the project. In contrast, the more each team member was “siloed” into knowing just their piece of the whole, the less successful the project.

Yes, yes yes. I now work for a company that believes in top-down and bottom-up understanding. I didn't always. I've always said that even the full-time janitor needs to understand the business goals in order to most-effectively do their job.

Phusion Passenger 2.1.1 beta released - looks great

http://blog.phusion.nl/2009/03/01/phusion-passenger-211-beta-released-thanks-sponsors/

  • Support for Rails 2.3
  • Improved compatibility with other Apache modules, such as mod_rewrite
  • Ruby 1.9 support
  • Support for NFS setups
  • Various I/O handling and scaling improvements and fixes
  • Improved mod_xsendfile support.
  • Ability to disable Phusion Passenger for arbitrary URLs (PassengerEnabled option)
  • Improved application compatibility
  • Better cross-platform support (including OS X)
  • Non-interactive installer
  • Improved command-line admin tools
  • Ability to display backtraces for all threads
  • Improved security
  • More customization options for exotic systems/setups
  • Various usability improvements
  • Various other minor improvements and bug fixes

This thing is really starting to look like a great and simple way to deploy *real* apps.

Free git training course

h/t to Ruby Flow:

Rubylearning.com is offering a free git and github training course. I don't have any personal experience with RubyLearning, but I hear good things and it might be a good introductory course for anyone that is just getting used to git.

http://rubylearning.com/blog/2009/02/10/git-and-github-a-free-course/

Hiivelogic: My Video and Slides from Acts as Conference 2009

Hiivelogic: My Video and Slides from Acts as Conference 2009

Slides have a great quote from Steve Jobs and the talk is really great.

Saying no to features is really difficult, but hugely important. It's nice to see Dan Benjamin pushing developers to push back on requirements. It's hard sometimes, but the end-product is really worth it.

I think the part that he doesn't dig into deeply enough is true understanding of the market your product is going to end up in. Too many developers get caught up in the code and the computer aspect of their product. It takes a lot of work to try to understand the user and the market surrounding the user.

A lot of times understanding the product is harder than writing code, but it's something that everyone in your team really needs to spend a lot of time educating themselves on in order to create a successful product.

Broken gets fixed…

DesignAday - Truism

"Broken gets fixed. Shoddy lasts forever."

One of the developers I work with said this after I complained about a lingering issue in one of our products. It rings true. When deadlines are tight, and there is more work to get done[...]

I know this is true for any website I've ever worked on (except the sites that I have created myself). You have experience with this?

h/t Daring Fireball

Deploying a rails app on a suburi

I followed the instructions at the phusion passenger site and couldn't exactly get my app to run in a suburi - it kept trying to use that suburi when looking up routes.

I had found this:

WRONG!

RUBY:
ActionController::AbstractRequest.relative_url_root = "/rails"

However, there was a deprecation warning - and it seemed not to work at all. I then stumbled upon this which seems to work:

RIGHT!

RUBY:
config.action_controller.relative_url_root = "/rails"

If you care - my virtual host looks something like:

CODE:
<virtualhost *:80>
   ServerName localhost
   DocumentRoot /Library/WebServer/Documents
   RailsBaseURI /rails

</virtualhost>

Beauty is the most important thing in software.

Beauty is more important in computing than anywhere else in technology because software is so complicated. Beauty is the ultimate defense against complexity.


David Gelernter, Machine Beauty: Elegance and the Heart of Technology

Amen. Amen.

I hate it when people use the argument: "but this worked."

h/t: A design and usability blog: Signal vs. Noise (by 37signals)

Pastebin

Made a rails-based pastebin today: http://github.com/tobowers/pastebin/tree/master. Very much alpha-ish code (without specs) but it seems to work fairly well, and I didn't see another rails pastebin out there.

Easy to add support for tons of languages. Right now it only displays the options for rails, ruby, javascript, plaintext, css, html, actionscript.

These two projects are pretty incredible (much nicer than the syntax gem):

http://textpow.rubyforge.org/index.xhtml
http://ultraviolet.rubyforge.org/usage.xhtml