Podcatcher Prototyping
I started this podcast project so I could learn some things I haven't had time to experiment with in my "real" job. Things like playing more with Ruby, trying out Behavior-Driven Development, and experimenting with Agile practices (plus I really wanted a better podcatcher program and I needed something to do over the winter). While I haven't produced much real code yet, I've created some simple prototypes and wanted to comment on some things I've been looking at.
I was using NetBeans and knew that it used the JRuby (1.0.2) interpreter by default. I switched the NetBeans interpreter to the "standard" 1.8.6 release and reran my tests. Both tests came back in about the same time - a little under 6 seconds. Interesting.
While researching RSS, I came across this article describing conditional get. Neither of these Ruby libraries appear to support conditional get, but I found a Java library called Rome which does. Because of my UI concerns (more on that later) I was curious how a Java implementation of this functionality would compare to what I was seeing from Ruby. The Rome prototype accessed the feed in less than 5 seconds, with the conditional get taking a few tenths of a second. Now I had a decision to make, stick with the plan to use Ruby or switch over to Java?
JBehave uses a "Given -> When -> Then" format to specify it's tests which looks very similar to the way RSpec does things. It does have a JUnit like test runner, but I couldn't get it to work from inside NetBeans (I used the Ant target instead). The Ant task didn't produce the green/red visual that I like with JUnit, but the tests did run. It looks as if the most recent release of this library was 12/2006 so I'm not sure how active this project is.
Instinct looks very much like JUnit. It uses annotations to define "specifications" rather than "tests" and "expects" instead of "asserts". Problem was, I couldn't get the example code's maven build to work from inside NetBeans. The most recent least was 12/2007, but it was for version 0.1.6 making stability and maturity a question mark.
Still undecided, I decided to take another look at Adobe Air. A while back, I looked into Flex as a framework to create Rich Internet Applications. What drew me to Flex, was how easy it was to create beautiful, interactive, user interfaces. Because Flex applications run in Adobe's Flash player (which is on virtually all browsers), these applications are very portable. Air brings that portability to the desktop, providing a runtime for applications to run in regardless of the operating system (similar to a Java virtual machine).
Reading an RSS feed
My first prototype was a very simple Ruby program to read and parse an RSS feed. I had found some code here using the standard Ruby RSS Parser so that's where I started. At first I thought it was broken, but after about a minute and a half it returned. This wasn't going to cut it, so I started to look for alternatives and quickly found the feed-normalizer gem. Some quick coding and the total time to access the RSS feed was reduced to about 10 seconds. Not bad, but I still wanted better.I was using NetBeans and knew that it used the JRuby (1.0.2) interpreter by default. I switched the NetBeans interpreter to the "standard" 1.8.6 release and reran my tests. Both tests came back in about the same time - a little under 6 seconds. Interesting.
While researching RSS, I came across this article describing conditional get. Neither of these Ruby libraries appear to support conditional get, but I found a Java library called Rome which does. Because of my UI concerns (more on that later) I was curious how a Java implementation of this functionality would compare to what I was seeing from Ruby. The Rome prototype accessed the feed in less than 5 seconds, with the conditional get taking a few tenths of a second. Now I had a decision to make, stick with the plan to use Ruby or switch over to Java?
Behavior-Driven Development
I was first turned on to the idea of behavior-driven development (BDD) back in October. My initial plan was to use RSpec with Ruby, but what BDD frameworks are available for Java?? As it turns out, there are several and I decided to try out JBehave and Instinct.JBehave uses a "Given -> When -> Then" format to specify it's tests which looks very similar to the way RSpec does things. It does have a JUnit like test runner, but I couldn't get it to work from inside NetBeans (I used the Ant target instead). The Ant task didn't produce the green/red visual that I like with JUnit, but the tests did run. It looks as if the most recent release of this library was 12/2006 so I'm not sure how active this project is.
Instinct looks very much like JUnit. It uses annotations to define "specifications" rather than "tests" and "expects" instead of "asserts". Problem was, I couldn't get the example code's maven build to work from inside NetBeans. The most recent least was 12/2007, but it was for version 0.1.6 making stability and maturity a question mark.
User Interface
Because I wanted this podcather to be something I'd use, the user interface is something I've been thinking about as well. I've previously created an Eclipse RCP client application so I knew I could build the UI I wanted there. I wasn't sure I could build a "good enough" interface in Ruby using it's Tk bindings. As luck would have it a recent RailsEnvy podcast reminded me of Shoes, an alternative windowing toolkit for Ruby. Like Instinct, it's still fairly early in development and I'm a little concerned about it's stability.Still undecided, I decided to take another look at Adobe Air. A while back, I looked into Flex as a framework to create Rich Internet Applications. What drew me to Flex, was how easy it was to create beautiful, interactive, user interfaces. Because Flex applications run in Adobe's Flash player (which is on virtually all browsers), these applications are very portable. Air brings that portability to the desktop, providing a runtime for applications to run in regardless of the operating system (similar to a Java virtual machine).
Comments