Wednesday, December 23, 2009

A brush with Eclipse RCP

In my current job I seem to do quite a bit of UI work. The nice thing is that since my company is a start-up, the possibilities (in terms of technology at least) are unlimited. In the last year I've written GUIs using C# & WPF, Swing, and JavaFX. This time we were looking to create a 'system monitoring application' which should be able to present different types of information:

  • Tables
  • Graphs
  • Charts
  • Trees
  • etc...
The application also had to be easily extensible. While I personally have a fair amount of experience in GUI development, my two junior colleagues have done much less UI work. So it was just as important that the technology we choose has a gentle learning curve. Given a 4 week sprint we don't have much time to 'waste'. I have evaluated our options:
  • JavaFx: low level, lack of tools and out of box components
  • Swing: low level, good tools
  • SWT: low level
  • NetBeans platform: have personal experience
  • Eclipse RCP: unknown
It was clear that given the extensibility requirement we needed a platform. It came down to a choice between NetBeans Platform and Eclipse RCP. In the end I chose Eclipse RCP because I was able to step through this tutorial with complete ease and I felt that even though I have experience with the NetBeans platform my team mates would be faster in picking up the Eclipse RCP way of doing things.

Now, a month later, I have to say that I believe that my decision was the right one. After 3 days of tutorials and reading we were ready to go. Ultimately we have created a UI which is modular (with multiple self contained plugins), looks and feels the way our client expects, and will be easy to extend. In addition, majority of the actual UI work (using JFace, SWT, databinding, Eclipse RCP APIs) was done by my colleagues while I focused on the data models.

While I would take the NetBeans IDE over the Eclipse IDE for most things I am quite happy with the way our RCP based project turned out given the requirements.

Thursday, October 01, 2009

Sending GlassFish java.util log records to Chainsaw - no problemo

To send Java log records to from GlassFish to chainsaw we need to first translate the LogRecords (from java.util.logging) to LoggingEvents (used byt the log4j framework and accepted by chainsaw). Then also need to publish the resulting LoggingEvents to Chainsaw over a socket.

Here is how I do it:

* Copy ChainsawHandler.jar and log4j.jar into GLASSFISH_HOME/domains/domain1/lib/ext

* In Glassfish admin web console under: Application Server/Logging/General/Log Handler enter:

au.com.horseshoelane.logging.HSLChainsawLogHandler

* In Glassfish admin web console under: Application Server/JVM Settings/JVM Options/ add a new JVM Option:

-DchainsawPort=4447

this is the port to which Chainsaw clients can connect

* Restart GlassFish

* Configure a new SocketHubReceiver in Chainsaw that will connect to the chainsawPort

In case you are curious how it works or want to add functionality or fix a bug here is the source.

I would like to thank my current employer HSL for allowing me to publish this work - which they have sponsored in the form of my paycheck :)

Wednesday, September 16, 2009

JavaFX + WebStart + Web Services + GlassFish = One cool client app

In this post I will give an overview of the architecture that I've used to supply a connected thick (JavaFX) client application to a customer.

Here is the scenario: our company has an important customer who wishes to access and view some real-time data related to their business.

After some thought we've decided that the ideal platform for the client app is JavaFX (eye candy), the client deployment method is WebStart and we'll provide the data to the client via a SOAP Web Service. Easier said than done it turns out :)

There are a few issues with this set-up.

CLIENT:
The JavaFX client app can be written without major problems (see my previous posts about my beef with JavaFX tools) but I've found it best to create separate Java module to handle the WS communication. This is also useful since Maven doesn't seem to be able to build mixed source trees. Therefor the client app is composed of two separate JARs:
- Java library to handle WS client code generation and some utilities that are easier written in Java
- JavaFX GUI client that depends on the Java library

SERVER:
Simple enough Web Service deployed on GlassFish v2.1 JavaEE 5. Nothing special to note here.

DEPLOYMENT:
This was one of the trickiest parts. Since we have a number of servers (dev, test, stage, production, etc.) and we want a client which is downloaded from a specific server to connect to the WebService running on that same server. This we achieved by using a servlet to dynamically generate the JNLP file for the WebStart deployment. The servlet plugs the correct values into the JNLP for two things:
- where the client jars are located (i.e. codebase)
- a run-time property for the client specifying the WS location
The client (once launched) uses the WS location property to connect to the correct web service.
The servlet gets this information from system properties which can be easily set using the GlassFish web admin console. This means that we compile the code once and deploy it to any GlassFish server and all works well as long as we don't forget to add the two properties to the server.

Monday, August 31, 2009

More JavaFX impressions

So I have been using JavaFX for about 2 weeks now. I am working on commercial application for a client and now that I am more familiar with both tools and language I think it's a good time to post an update.

Tools still suck - no surprise here :) but they suck even worse in Eclipse than in NetBeans so even though my workplace is an Eclipse shop we're using NetBeans for our JavaFX development. I've had a quick chat with David Kaspar, a friend of mine and one of the developers who are currently working on JavaFx tools at NetBeans and he told me that Sun is aware of the situation and it is about to improve, so FX support NetBeans 6.8 should be much better.

I really hope so because the language is awesome and despite everything I do enjoy working in it.

Tuesday, August 04, 2009

First JavaFX impressions

In my job I've been playing around with some pretty cool and new technologies lately. This gave me the opportunity to write a a WPF based video player (with some very client specific functionality) in C# in just about a month. Coming from Java background with no prior .NET experience at all, it was quite an accomplishment. But it is not simply a credit to my genius but mostly to the tools that were available to me: Visual Studio with ReSharper. As occasional IntelliJ user I was soon very comfortable and pumping out code like nobodies business. As a SWING developer used to working with NetBeans forms editor I found the XAML editor fairly intuitive.

This brings me to my JavaFX experience. I've been assigned the task of evaluating technologies for a new UI project. I am currently down to either SWING or JavaFX, and while I would really love to use JavaFX there is a single major reason that is making me very hesitant:

Lack of Good Development Tools

While I love the demos that I downloaded for JavaFX I am sorely disappointed with the available tools. It's kind of sad really, since most of my old colleagues at Sun who used to work with me on Mobility support are working on JavaFX support now. I know many people on that team and they are some of the smartest most capable developers. Something must have gone very wrong along the way because at the time of writing this I personally find the JavaFX support in NetBeans to be an embarasement. The most basic features are missing from the editor which makes it a major pain to work with (source formatting, cut/paste imports, automatic imports while typing, auto-completion is of mark at times, etc. etc.). This makes it very difficult for me to be productive with the language from the start. Sun has been pushing JavaFX hard because it does enable some very cool UI magic but I wish they put as many resources into making it usable to developers thus speeding up adoption.

I will continue to play around with JavaFX and I hope that in the end I'll find that I can live with (and remain productive with) it's current tool set.

Saturday, April 18, 2009

Cotopia: Over 1 Million games played

That's right folks - we've had over 1 million games played!! Isn't that awesome? It makes me very happy that we've been able to bring our community that much fun. I mean seriously, more than 1 million games, I can hardly believe it. It's been a good ride for us on the development team and I hope that we'll soon celebrate by releasing the long awaited mobile game of Go.
I'd like to send a big 'Thank you' to our community for making this happen.

Sunday, April 12, 2009

Economy and IT jobs in Sydney

I thought that I'd quickly comment on the state of affairs regarding IT / jobs / economy here in Sydney. I was affected by the economic downturn just like many others, as companies shed contractors to tighten their budgets. This was around 2 months ago. I has taken me 8 weeks to find work - half of that time spent looking while I was finishing off my previous contract at a great Sydney IT firm Object Consulting. 8 weeks is the longest it has taken me to find work since 2002. Usually I have a job withing 2-4 weeks.

I normally look for senior developer positions related to JavaME or Core Java / Swing, which is not where most of hiring happens - any Java developer will know that majority of advertised jobs resolve around web, databases, finances, or insurance (i.e. gather financial/insurance data on the web and stuff it into a DB - not my cup of tea). This definitely doesn't the job search any easier but it ensures that usually I find something at least somewhat interesting.

In addition to taking a few extra weeks to find a job I also have to say that the compensation packages on offer are not exactly what they used to be a year ago, but they aren't completely unacceptable either.

To sum up - I believe there is work to be found even for those of us that are a little more picky, even though it may take longer to find it and one may have to do with less money.

Saturday, February 28, 2009

Doing my bit for atheism :)

OK, so here is an idea for like-minded people.

At our local bookshop they have a "Religion" section with all sorts of books. Unsurprisingly, propaganda and early indoctrination literature (i.e. Children's bibles, Good News bibles, and other bibles) is on the eye-level top shelf. While some of my preferred reading such as "The God Delusion" or "God is not Great: How Religion Poisons Everything" sits on the very bottom shelf where it doesn't receive proper attention.

The thing that I like to do, when I browse in the store, is to rearrange the books to correct the unfortunate placement of my favorites. I do this about once every 2 weeks or so.

That's the whole idea. I am not sure how much it accomplishes but since there is no church of atheism where I could make donations it's one fun way I like to try and forward the cause.

Wednesday, February 11, 2009

Starship Sofa

Again with the Podcasts :)

I've recently discovered another excellent SciFi podcast at http://www.starshipsofa.com
I was completely blown away by it's first short story (by Michael Moorcock no less) called London Bone which in it's quality (writing and production) rivals to that of Variant Frequencies.

The thing about Starship Sofa is that they tend to put out stories by established authors rather than by new and upcoming ones. There have been a couple of stories I've skipped, I guess every 5th or so, whereas on Variant Frequencies I have yet to skip one. This, I guess, is because the Sofa tends to cover a broader range of stuff and some things are just not my cup of tea, however the stories that stick do so in a big way!

Give the Sofa a listen - I can pretty much quarantee you'll like it.

Sunday, February 01, 2009

SF & christian indie music - wtf??

Off-topic rant warning.

I love sci-fi and sci-fi story podcasts - hence I love Escape Pod (I've donated about $200 to them so far) and I love Variant Frequencies - they don't ask for money so I didn't give them any yet.

My rant today is about Variant Frequencies, VF is a monthly podcast and in my opinion it's simply the best in terms of quality (both writing & production). The guys behind VF are simply amazing. Except... Except in the last episode called "Creature of God" (which admittedly has some religious themes as the name would imply) the featured an advertisement for indie christian rock music or some such non-sense.

To me the reasons for doing this may be that:
1. the guys at VF are religious and are actively trying to help spread the virus
2. or it may be that they are short of cash and thus in need advertisement dollars

If case 1. is true I am very disappointed, and I feel a bit tricked. It kind of reminds me of one beautiful day in my teens when 2 VERY pretty girls we smiling at me from across the food court in the mall. They then approached me (giggling), made small talk and were being extremely friendly, and then they asked me to come and meet them again in their church :) Wow, what a recruitment strategy, even the Army won't go that far.
Perhaps VF isn't doing exactly the same thing but I do feel baited in with some pretty awesome SF and then hit with a completely bullshit religious advertisement.

If case 2. is true (and I hope to .. err.. I mean I really hope so) I would suggest to VF to put up a paypal donations button on the front page, ask for money at the end of the show, ask for money at the start of the show, put some non-offensive adverts for headphones in, do whatever else but please stay away from pushing religion. I've bough Scott Sigler's books, I've given a fair amount of money to EscapePod (and the guy from there once mentioned he is religious - to my great surprise) so I will definitely support my favourite sci-fi podcast EVER by donating, and once "The last fix" comes out in Australia I buy the book.

If I missed case 3. I hope it's a good one that doesn't involve propagating the evil of religion on purpose.

Saturday, January 31, 2009

spring - hibernate - ejb3

I am looking for work since my contract at Object Consulting in Sydney is up in two weeks. There are some interesting jobs out there but very few. Australia, it seems, has been hit by the global crisis pretty hard. Given the current situation I am slowly giving up on finding myself something in the Mobile area and there are very few jobs for Swing/GUI developers as well.
So, as usual, we're left with crappy jobs for insurance companies and banks, chasing around and persisting the oh-so-important transactional business data. How exciting. But man's gotta do what man's gotta do. Looking at the market, EJB3 (with which I have some experience) is losing to Spring (in employer demand at least) and/or Hibernate. Pressed by reality I've decided to start with Spring and I've gone through a few tutorials. So far I am not too happy with the fact that Spring functionality seems to be configured by XML - I love XML for passing data around but pretty much hate it for everything else. Hopefully as I dig in deeper I'll find that EVERYTHING can be done through annotations :)

Tuesday, January 20, 2009

Talibanistan

It is not everyday that a country is born, but here is a new one that I have discovered only recently.
So it is with great pleasure that I welcome all the players from the new country of Talibanistan who play Cotopia games into our community. It is with hope that we can bring relaxation into their otherwise strictly disciplined lives.

Sunday, January 18, 2009

Project Darkstar 0.9.8 incompatible changes a pain in the butt

Some time ago I've created a Netbeans plugin for project Darkstar. I've had good fun writing it and for the most part even maintaining it. The trouble with writing a pluging that depends on a piece of software with version number like 0.x.x is that it's external interface (the way it is started/stopped etc.) is bound to change often and sometimes quite drastically :)
There have been some minor changes in the past but mostly I was able to deal with them inside a few hours, this time however, I got blown away. Darkstar version 0.9.8 completely changes the way the server is started and stopped as well as the way applications are deployed. It has changed the internal directory structure so that version 0.9.8 is no longer even recognized by my plugin (just as well since none of the other functionality would work anyway).
Despite the fact that I will have to rethink the whole plugin UI and internal workings I am very excited about this development because it is definitely for the better. It is now easier for anyone to work with Darkstar even from command line, and the fact that application.properties file is now included inside the application JAR, rather then a separate file, means everything makes more sense and will fit better with the NetBeans way of doing things. It is good to see that Project Darkstar is moving forward in the right direction. It makes me feel that my decision to support it and invest my time was the right one.
I already have some ideas as to how I will approach the new UI which should make the NetBeans plugin more useful and powerful.

Wednesday, January 07, 2009

Good work Scott Sigler

I love books, but I find it easier to have someone read to me than to read myself :)
I have been following the work of Scott Sigler for a while now, his Earthcore novel was the first podio book I've listened to and it turned me onto some pretty good stuff, but I've blogged about this a bit in the past.
The reason I am mentioning Scott Sigler is that, to me at least, he is quite an inspiration. He's been an aspiring writer for many years but had bad luck getting published. After being reduced to (and I quote here) "giving ****jobs for food stamps" he's figured out how the Internet can help in promoting his work. Some years later now Scott has given out a number of very entertaining books in the audio format for free and is aiming for the NYT best seller list with his latest published book Contagious.
If you like a fun light book that will entertain give Scott a listen/read.

iPhone development

Tom has been saying that we should have iPhone versions of our games to attract more crowd. I have been reluctant to take this on board since I have no clue about iPhone development. Today I got curious however, and so I downloaded the iPhone SDK (1.6GB btw, wtf??). The sheer size of the SDK was one shock and Objective-C was another shock. Are they serious? I would have to learn not just an API but a whole obscure language to throw an app together. If it was a language or a framework that I could reuse elsewhere (eg. Flash) I may give it a shot, but not this.

I am sorry to say but at this point it seems like too much of an investment. So as far as I can tell, there will be no iPhone support for some time to come. The Google phone on the other hand is a different story.

Monday, January 05, 2009

Can you smell it?

Cotopia Go is so close that I can :)