Tuesday, March 31, 2009

MassTransit

Earlier this month, I mentioned the MassTransit project, an open-source .NET Enterprise Service Bus implementation, a topic sure to break the ice at a many a party.

We've been getting stuck into MassTransit at work for a major project, and had all sorts of problems along the way, mainly due to the youth of the project and the general lack of documentation. Where there were code samples, sometimes the code just plain didn't work.

Blog postings need images, apparently; so here's one that's distantly related to the topic under discussion - it's a restaurant tram in MelbourneThe two main developers, Dru and Chris, have been a fountain of knowledge and general helpfulness, responding quickly to my sometimes continuous barrage of questions, not helped of course by our being on opposite sides of the planet. I've been able to chip in with the occasional patch, nothing to fancy at this stage, but at least enough for me to feel like it's not a completely one-way street.

Anyway, congratulations to MassTransit for shipping their v0.6 release candidate. I've been running it for a few days now, although without using some of the cooler pieces of new technology, such as the saga state machines. Hopefully with their help, I'll be able to get our project back on track and heading in the right direction.

Thursday, March 19, 2009

Topshelf

At work, I'm currently working on a project which requires the integration of several different systems, some of them hosted on the internet, and some on different sides of the corporate firewalls. This means that we can expect to lose connections between systems, which naturally pointed us in the direction of message queues, which are designed for such scenarios. A chat with a former colleague pointed me in the direction of enterprise service buses as the core technology to take care of all the plumbing; and after comparing feature sets with our requirements, I downloaded MassTransit.

What interested me was a spin-off from the MassTransit project, called Topshelf, which has a single and simple aim - to get rid of all the cruft associated with actually launching .NET programs, especially all the boilerplate code you have to come up with to run services.

I ran into a few issues though: the first was that before, I had been using the WiX's ServiceInstall code to handle all the service registration, such as setting the service name, description and credentials. However, Topshelf provides its own code to do that, and the two aren't compatible. In the end, the solution I came up with was to remove the WiX code and use Topshelf's, which would be invoked by a custom action in the WiX script:

<CustomAction Id="InstallService" FileKey="ServiceExe" ExeCommand="/install" />
<InstallExecuteSequence>
    <Custom Action="InstallService" After="InstallFinalize" />
</InstallExecuteSequence>

FileKey is just a reference to the Id of the executable for the service, and ExeCommand contains the parameter(s) to pass to it.

All well and good, but unfortunately, Topshelf's implementation currently launches the same dialog box that installutil does, and if you're trying to produce an unattended install file, a dialog box is the last thing you want. I've had a little play around with the source code and came up with something which would technically work, but was nowhere near as elegant as the rest of the code, so I'm not planning on submitting it.

I did add a few refactorings and documentation into the codebase, nothing clever or anything; I then submitted the changes as a patch to Dru, and within the hour, they had been committed to trunk. This really reminds me why I love open-source programming so much - if the application doesn't do quite what you want it to do, you can download the source code and modify it, and if it works well, you can contribute that change back to the community. Talk about a win-win situation. Non-open source companies have to think about every way that people will use their software, and then program all that functionality in, thus proving the 80-20 rule - 80% of your users are only using 20% of your application's functionality. Did you know that Microsoft Word has a Japanese Greeting dialog box, which allows you to select a greeting specific to the month of the year?! I wonder even how many Japanese people know it exists?

Japanese Greeting dialog box from Microsoft Word 2003

Speaking of contributing to open source, I've accepted a couple of patches to my SvnRevisionLabeller project, and should be releasing a new build soon, once I've figured how to get some good tests in there. You are testing your software, right?!

Thursday, March 12, 2009

This stuff is supposed to be fun

So blogged Jeff Attwood some 18 months ago, and as far as my own experience goes, he is absolutely right. When I went to university, it was to study Electronics and Communications Engineering, but by mid-way through the second year, I really wanted to on Computer Science, but really it was just too late to be changing courses, so I stuck it out to the end. To show willing, I applied to some of the major electronics companies like Philips and Marconi, but nothing came of that, so I managed to convert my summer job at the Foreign & Commonwealth Office into a more permanent job, doing typical admin stuff in the library. A healthy dose of luck and good timing saw me slide into an IT helpdesk/sysadmin role, and from there, I never looked back.

I was then able to leverage (how I hate that word) my IT skills to get into development, and there I knew that I had found my real métier. Like no doubt thousands of my technical colleagues, I have found the perfect union between my favourite pastime and my job. My wife still marvels that I spend eight or more hours a day at the office working with computers, and then when I come home, I'm happy to spend the rest of the evening, or most of the weekend, doing exactly the same thing (and not getting paid for it!).

In fact, I enjoy being a developer so much that I will do everything in my power to avoid promotion to a position where I can't sit down and write code every day. For some, it may be just a step on the ladder to management, and that's OK; but for me, the day I stop coding and using computers is the day they prise the keyboard from my cold, dead hands.

In short, I know what colour my parachute is; and being a self-professed geek, it's black.

So are there any other categories of people out there whose private life seems to be just an extension of their working life? Or perhaps even better, they see it as the other way round, where they're getting paid to do something they could spend every day doing? Musicians? Sportsmen? Accountants, anyone?!