Richard Dallaway Hello! I'm Richard, and I write things down here.

19 Jul 2007

Java Caching APIs

Last month I attended a superb presentation on JBoss Cache by the project lead, Manik Surtani. Luckily only six people showed up, so were were able to chat to Manik, and really pick his brains on this stuff. Talking to Manik gave me a huge amount of confidence in the JBoss Cache product.

Some background to all of this: we’ve all probably kept something that’s frequently used, and infrequently changing, in memory to save a trip to a database. That’s one of the things you can use a cache like JBoss Cache for, but that are other benefits too: the preference for code that’s been written elsewhere (many eyes etc); a smart way to do invalidation; a way to distribute a cache between servers; reporting tools… and so on.

05 Jul 2007

Comments for Logging

Logging can become quite verbose. I found myself writing a method in which most of the lines were logging related, which really clutters the code:

if (source == null)
{
 if (log.isDebugEnabled())
 {
   log.debug("No copy required as no source provided (dest was "+dest.getAbsolutePath()+")");
 }
 return;
}

Possibly I’m over-logging, to try to avoid ever running a debugger. But I was wondering if it’d be possible to do something so that I could turn on logging of comments for a given method, class, package or whatever. So if I’d written….

19 Jun 2007

Google Developer Day 2007

I was in London for the GD Day 2007. I sat in on some pretty interesting sessions:

Go watch the videos.

08 Jun 2007

Google London Open Source Jam 3

A couple of weeks ago I was over at the Google London Open Source Jam 3, which was focused on Java. I wasn’t sure what to expect, but it turned out to be a series of five minute talks. I’m not sure if that’s normal or not for the Open Source Jam series.

If I had to pick out one thing, I’d say take a look at the closures talk. I’d thought closures for Java was on it’s way to being sorted, but it turns out there are three proposals with pros and cons:

19 May 2007

JavaOne 2007

For the impatient: impressive Seam and JRuby/NetBeans demos; JavaFX doesn’t look that crazy after all; performance improvements show promise; quality of the talks were consistently high and better than I recall from previous years; need to look at Groovy and Grails more.

Duke'07

I don’t like to make too much fuss about these events, but when I go into the first keynote on the first day of JavaOne, look around and see the size of the place (space for just 15,000 attendees this year), look at the huge screens on stage, with DJ Anon doing her thing, and then the big numbers come out: 6 million developers, 2 billion mobile devices, 11 million TVs, Java on 91% of desktops. I have to admit to being somewhat awed by the event. They do a good show. It’s not Steve Jobs, but it’s pretty good.

30 Apr 2007

Container Services

You don’t need to use all of Java EE to build an enterprise application. Partly because of that I’ve always been nervous of big EE application servers such as JBoss, Glassfish, OC4J, WebLogic, WebSphere, and instead I’ve preferred mixing and matching open source libraries and stand-alone components. Or maybe I just don’t need the features, or I’ve not run into scalability or transaction control that containers help manage, or maybe I’m not convinced on the benefits of a “single solution”. So although I have ended up using them for some projects, I’m not sold on the need and I’ve never really thought they make life easier.

05 Apr 2007

Microformats

Last night’s Sussex Geek dinner featured Glenn Jones with a presentation on Microformats. I learned a lot in a short space of time.

My previous impression of microformats was that it was a kludgy way to piggyback contact and event details into HTML—clever and useful, admittedly, but a kludge nonetheless. But I was totally wrong. I recommend grabbing the PDF presentation and taking a look for yourself, but it turns out the attributes used to mark-up XHTML with contact details and the like are, for want of a better word, legitimate. For example, using the class attribute to identify a name of a person is fine: the XHTML spec describes class as good for pretty much any use: “The class attribute can be used for different purposes in

08 Feb 2007

Mac OS 10.4, Apache, Subversion

I recently set up a Subversion server on my Mac OS 10.4 MacBook Pro. It was, amongst other things, a test-run for installing SVN on an XServe. It was somewhat involved, so here’s my reminder on how to do this. Hopefully when 10.5 ships a lot of this will just go away.

The goal is to: install subversion, convert an existing CVS repository to SVN, set up Apache to access the repository, set up some access restrictions, and get it running over HTTPS. The starting point is that 10.4 ships with Apache 1.3, and I’d already installed a SVN client from a .dmg, but you need Apache 2 and to install Subversion from source to get the Apache SVN module compiled up, so that really doesn’t matter (the Mac OS 10.4 server, BTW, ships with an Apache 2.0 instance for “evaluation purposes”, but I’m going to ignore that as we want the latest and greatest Apache really).

21 Jan 2007

OpenStreetMap

Mikel Maron’s fireside-style talk at the Sussex Geek Dinner was a great introduction to OpenStreetMap: “providing free geographic data such as street maps to anyone who wants them”. If you need to know anything about this area, Mikel is clearly the person to talk to.

Jane’s blogged about the talk, so I’ll skip that and just mention that the talk inspired me to take another look at the Bluetooth GPS unit we have. Turns out it’s easy to get the GPS unit running with a MacBook via the terminal: pair with the device, and then in Bluetooth Preferences, select the device and check the serial ports. In my case, I didn’t have to do anything, as the Mac had already set it up as a serial device. From the shell, you can then connect to the device…

13 Dec 2006

Generics in Comments

For a project I’m involved in that is stuck using JDK 1.4, I’ve found doing this soothing:

 List/*<Stuff>*/ getStuff(); 

It’s documentation, and gives me the hope that one day I can remove the comments for this particular project.

05 Dec 2006

Next Net

Thanks to Ewan Silver and others for organizing the Next Net meet up. It’s sort of a London Jini Group, but more general: a gathering of people interested in distributed (utility computing, grid computing, massively scalable, resilient) systems.

I unfortunately missed a large chunk of Dan Creswell’s presentation on Utility Computing with Amazon EC2. What I could figure out rekindled my interest in these technologies.

For example: On my way over to the meeting I was wondering about how best to distribute database load somehow or other. When I walked into the meeting, the presentation was discussing doing-away with things like relational databases to obtain big scalability, and shifting mindsets away from Java EE. Ah. So think different.

01 Dec 2006

UTF-7

Encoding problems

Character encoding is one of those things that needs careful attention all the time. My usual take is: “UTF-8 is the answer. What was the question?” UTF-8 has some handy properties, such as being compatible with ASCII, while being able to store any Unicode character. It’s described nicely in What Is UTF-8 And Why Is It Important? and more generally in the Java Internationalization book.

But other encodings are available, and I recently had to deal with UTF-7. This was a new one on me, but if you have to deal with low-level email encoding, you’ll find it’s surprisingly popular. The big thing about UTF-7 is that content can be included in SMTP without having to wrapper it in base64 or some other transfer encoding.