A blog about software development and other software related matters

Blog Archive

Wednesday, March 5, 2008

Getting ahead with the program

Well it's been a week since my last post (time moves fast isn't it?) and had the need to write about some new idea's/solutions/stuff that iv found, so without further ado:

In the gookup front iv made some progress with the packging scheme of the application, the problem is that Ruby/JRuby programs need to have at least a parser installed in order to work (well almost true since for Ruby you may use somthing like RubyScript2Exe), still i don't want to make my users have to install JRuby (the only requirement that im willing to live with is the need to have a working >1.5 JRE).
After goggling quite a bit iv found two main approaches, the first is to use a main Java class as an entry point to your JRuby main code and package the whole application in a Jar, the down side with this approach is that it doesn't seem to answer how to package ruby gems that your application requires in a clean manner (a possible answer might be to use something like JRubyGems ).
The second approach is to use jruby-complete.jar and create a working JRuby environment as a part of your install process with something like this:

java -Xmx512m -jar jruby-complete.jar --command gem install gem-name

This will create a gem library under .jruby (or any custom library with the -Djruby.home=/custom/path flag) onto required gems will be installed.
In order to run your JRuby main code all you need to do is to issue:

java -Xmx512m -jar jruby-complete.jar --command main.rb

Iv not decided which one of them ill eventually use (if any), the nice things about these kind of projects is how they evolve and grow.

Another two related tidbits:

  • Since this application will be command line base iv decided to look for a Ruby library that will save me the trouble of parsing commands from the user, cmdparse seems to meet my expectations, not only does it have an nice design but also a default help and version commands by default.

  • Another issue which bothered me along the development process was the lack of a debugger in my IDE, im used to the Intellij debbuger but it doesn't seem to support JRuby code yet (Netbeans does), ruby-debug seems to be have ported to JRuby (haven't tested it yet) and from this screen cast it looks pretty awesome!

In the Flex front iv been taking baby steps in trying to figure out how things are related to each other, iv noticed is that Adobe has a tendency to rename things quite a lot (marketing takes it tall i guess), so that Flex Data Services is now called LiveCycle Data services, LiveCycle consists of a couple of parts of functionality out of which im only interested (at the moment) in Flex remoting services and the way that they interact with Java backends, this small fraction of functionality is distributed in a OSS distribution named BlazeDS project.
One frustrating thing that iv noticed is that Flex 2 compiled SWF's aren't compilable with latest BlazeDS, iv learned this the hard way following this simplistic getting started guide, (My bad it seems as if i haven't passed mxmlc flags during compilation)
iv learned that Flex RIA has couple of remote call options, one of which is RPC-type services which basically enable Flex RIA's to call remote Pojo methods and cosume the return values that they produce, its also possible to call managed Spring beans methods by using a custom factory.

Im planing to develope some toy project that will incorperate Flex, Spring and Hibernate, ill share my experience here so stay tuned!

No comments: