Some time back (around the 2nd week of May '09) I deployed my Jirb Online web application on Google App Engine for Java (GAE/J): http://jirbonline.appspot.com
It was not as straightforward as I'd hoped but was an interesting experience that gave me some insights into dealing with GAE/J and JRuby. This is how I went about it:
I registered for the GAE account and got an invite for trying out GAE/J. I registered using the mobile phone option: you get a code via sms that you need to complete the process. The Vodafone network in India failed to deliver Google's sms to me but IDEA worked. I got myself: http://jirbonline.appspot.com
... Read More (1001 words)There are certain programming practices that work when done at an individual level but need careful application (and probably ceremony) when working in a team.
For example, pulling out small domain classes for things like Money, Range, Link, etc is a good idea. I'm used to doing that in my day-to-day programming... problem is that my team mates have the same good habits.
So after a while, you may run into more than one class representing the same thing. If a concept is tied to your project's domain, it is very likely to have an impact on various features (user stories), and hence, different team members may end up having to implement that same concept. If folks do not realize that a class for the concept is already implemented, they may accidentally add more copies of the class. In my current project, we had Link, ServiceLink, and Url almost doing the same thing until we noticed the duplication and made all consumers use just Link.
After writing about the Singleton class in Ruby, it is time to write about the Metaclass.
Note that some people use "metaclass" to mean a normal singleton class (aka eigenclass) but that is incorrect. The Ruby metaclass is a special type of singleton class, one for a Ruby class object (hence the term "metaclass", I guess).
Recapping what we know about the singleton class, in the following example we can guess where the definition of the method find_by_name goes:
... Read More (686 words)A long while back for a Geek Night at ThoughtWorks Pune, I had come up with a JRuby sample web application that simulated jirb.
jirb is the interactive JRuby console that allows playing around with JRuby code in a quick interpreted environment. Plus, since it's JRuby it allows you to interact with Java code too.
Over time I simplified the web application, removing the unnecessary use of an MVC framework (Struts2), going for direct integration of JavaScript and Java code via the DWR AJAX library. The Java objects in turn talk to the JRuby runtime to execute the Ruby scriptlets being sent from the browser.
... Read More (170 words)In the April 2009 edition of the Golden Gate Ruby Conference, Matt Aimonetti gave a talk on CouchDB. The summary provided at the website seems interesting and even useful. Apparently, to prevent any risk of his talk seeming dry, Matt contrasted using CouchDB to performing like a porn star (his slides can be found here).
... Read More (262 words)