Saturday, 26 December 2009

Installing SubVersion with Apache2 on Ubuntu 9.10

First start off by installing Apache:

sudo apt-get install apache2

Enter the root password and follow the instructions. Check that is it installed correctly by going to http://localhost and checking that you see the standard Apache "It works!" message. Then install subversion and the subversion Apache module:

sudo apt-get install subversion libapache2-svn

Then create a directory to store repositories in:

sudo mkdir /var/svn/
sudo mkdir /var/svn/repositories


and create a test repository:

sudo svnadmin create /var/svn/repositories/test

So that Apache can read and write the repository its user (www-data) needs to be given ownership of it:

sudo chown -R www-data:www-data /var/svn/repositories/test

To be able to authenticate users who access the repository a password file is needed:

sudo htpasswd -c /etc/subversion/passwd paul

Enter a password for the user paul. For additional users repeat the command without the -c option to make sure the existing file is appended to rather than replaced.

Then edit the Apache config file:

sudo gedit /etc/apache2/apache2.conf

Add the following to the end of the file:

<Location /svn>
DAV svn
SVNParentPath /var/svn/repositories/
AuthType Basic
AuthName "Test"
AuthUserFile /etc/subversion/passwd
Require valid-user
</Location>


Save the config file and restart Apache:

sudo /etc/init.d/apache2 restart

The Test repository can now be accessed via http://localhost/svn/test

Reference

https://help.ubuntu.com/9.10/serverguide/C/subversion.html

Installing Eclipse Galileo on Ububtu 9.10

Before installing Galileo on Ubuntu it is worth making sure you have a decent and reasonably recent Java SDK. Open a command prompt and enter:

sudo apt-get install sun-java6-bin sun-java6-jre sun-java6-jdk

enter the root password and follow the instructions. Once the SDK is installed, check the version:

java -version

This should give you something along the lines of:

java version "1.6.0_15"
Java(TM) SE Runtime Environment (build 1.6.0_15-b03)
Java HotSpot(TM) Server VM (build 14.1-b02, mixed mode)


If you get something that suggests a different SDK is install run the following command to remove it and try again:

sudo apt-get autoremove

Then download Eclipse from the Eclipse download page: http://www.eclipse.org/downloads/

Once downloaded unarchive it:

tar xvfz eclipse-jee-galileo-SR1-linux-gtk.tar.gz

and move the eclipse directory into /opt:

sudo mv eclipse /opt

It is now possible to run Eclipse with the following command:

/opt/eclipse/eclipse

however, as Eclipse uses the latest version of GTK and this is not installed in Ubutntu 9.10 by default, a number of dialog buttons will not work. To work around this problem create the following script in the eclipse directory:

gedit /opt/eclipse/launch.sh

#!bin/sh
export GDK_NATIVE_WINDOWS=1
/opt/eclipse/eclipse


Then use the chmod command to make it executable:

sudo chmod +x /opt/eclipse/launch.sh

Noe Eclipse should be launched by calling the script:

sh /opt/eclipse/launch.sh

and all buttons should work correctly. Finally to create a desktop icon, right-click on the desktop and select Create Launcher. Enter Eclipse as the name and the above line as the command and click OK. Then right click on the desktop icon and select Properties. Click on the icon and navigate to /opt/eclipse and open the icon.xpm file. Then click OK to close the properties dialog.

Tuesday, 22 December 2009

Java Dependency Management with Ivy - Part II

In Part I of Java Dependency Management with Ivy I looked at basic Ivy usage and configuration using Ant and the Ivy Eclipse plugin, IvyDE. I demonstrated how Ivy can be used to download modules (dependencies) from a repository, such as the Maven Repository and cache them locally, negating the need to check them into a source control system.

However there are some scenarios where the Maven repository is not suitable:

1.Your development team may not have direct access to the Maven repository or you want to prevent each module from being downloaded more than once.
2.You may want to restrict or specify the modules your development team has access to.
3.You want to use libraries such Microsoft's SQL Server JDBC driver or your own propriety JARs that are not hosted in the Maven repository.

Ivy and IvyDE can be easily configured to look at custom repositories. In this article I will discuss a way of setting up a local public repository and a shared repository, and how to reference them from Ivy and IvyDE.

In my previous article I also explained the difference between a repository and a cache. As I am going to look at repositories in a little more detail it is worth repeating the distinction. A cache is usually local. When you do a build, Ivy checks the cache to see if you already have the required modules. If you do, it uses them, otherwise it looks in one or more repositories for them and downloads them. Repositories can be local, but tend to be remote on the internet or on a central server in an organisation. Maven is a repository and stores a large number of modules.

More

Saturday, 19 December 2009

House of Suns

House of Suns
by Alistair Reynolds
ISBN: 978-0575082373

This is much more like it! Reynolds' best work outside of his Revelation Space series. I loved the characters, their interaction and the way he swapped the first person between the two main characters and the young Abigail Gentian.

From reading the back of the book, which describes Abigail Gentian splitting herself into multiple clones, two of whom fall in love, I was expecting the two lead characters to both be female. Maybe that would have been a step too far?

Reynolds describes this book as stand alone on his website. I'm really rather hoping there will be some more.

Thursday, 26 November 2009

Gun at Nottingham Rock City 2009

First up were New Device, a very good young rock band. Good vibe, good sound and tight musicians. Very enjoyable to watch, I won't be buying any if their CDs though.

Gun, to my surprise had the ex-little angel Toby Jepson singing for them. A deeper voice than the original singer, but still very good. They opened with don't say it's over, which is one of my favourite songs. About halfway through the show was stopped by Toby as someone was starting a fight. He demanded they were thrown out as there was no place for that behaviour at a Gun gig. Inside, outside of love included a cover of the Police's So Only. All the way through, Gun made it clear that Les Paul guitars were made for Rock bands like this. They finished with Steel Your Fire and Shame on you. And Encored, of course, with a superb Word Up, the place erupted.

Threshold at the Garage 2009

Pythia, a fairly good female fronted metal band, were up first. The matching tshirts were a bit much , as was the shrill, slightly irritating singer. Overall I quite liked them, but not enough to be persuaded to buy their CD from the merchandise stand.

Serenity, who were up next, completely blew me away. An absolutely superb prog/power metal band. They were heavy in places along with great ballads and an exceptionally strong signer. They did persuade me to part with money for both of their CDs!

Threshold are always superb. Plain and simple. They played lots of old stuff as well as some new stuff. I loved it all. The guitar sound wasn't mixed properly in critical mass, which was a shame, and I had to leave early to get a tube. I only missed Mission Profile, Pilot in the Sky of Dreams and Slipstream, but given that they are three of their best songs, I did miss out.

Thursday, 5 November 2009

Stranger in a Strange Land


by Robert A. Heinlein (978-0340938348).

This book lacks much real science fiction. At most it's a fantasy book. What it really is is a dig at society and religion and that, unfortunately, stifles a story that actually isn't there. Many science fiction books make these points as well, but that doesn't make this science fiction. If this was a relatively new book I'd say it's all been done before, but given its age, all I can say is that it's all been done again since and better. If I was reading it in the 1950s or when I was a teenage boy, I'm sure I would have loved it.

One ray of light in an otherwise dull read was one of the main characters, Jubal. The story is very much told through his, very sensible, view on the world. He understands everything perfectly, has seen it all before and is never fazed by anything. While everyone else is giving into their prejudices and preconceptions he is watching and making sense of it all.

The ending was probably the worst part. The main character is murdered for the good of the people, his followers rejoice and then he visits Jubal from beyond the grave. Time for some more Alistair Reynolds I think.

Sunday, 18 October 2009

Item 57 - Use Exceptions only for exceptional conditions

Using exceptions only for exceptional conditions is something we can all agree with. However, this item should have been named "Don't use exceptions for control flow and how to decided between state-testing method and distinguishing return value". Bloch gives an example of how exceptions can be used for ordinary control flow, two alternatives in state-testing method and distinguishing return value and how to choose between them. I was rather hoping for some discussion of what exception conditions are, not just a brief discussion of what they are not.

Sunday, 11 October 2009

Java Dependency Management with Ivy Part I – The Basics

Along with the rich enterprise libraries that come as part of the language, one of the biggest advantages of Java is the vast number of third party libraries available. For example if you are writing an enterprise web application, GWT, Spring and Hibernate provide a framework with a huge amount of pre-existing functionality.

The size and number of dependencies grows as your application grows. GWT and Spring alone, without their dependencies, are more than 7MB. The ideal place to put dependencies is in a source control repository as part of your project so that when you or your continuous integration server check out the project for the first time all the dependencies are there. Then you don't have to go and get them and store them locally in a location that is agreed by the entire development team.

Storing the dependencies for a single project in a source control repository isn't too bad, provided there is plenty of room on the source control server.. However, if you have more than one project using the same or similar sets of dependencies the amount of space taken up in the source control repository starts to get a bit ridiculous. And then when a new version of a library comes out and you upgrade, even more space is wasted as the differences between binary jars cannot be detected, so the entire jar must be replaced.

Read more

Item 55: Optimize Judiciously

Bloch gets this item so right! He includes some famous quotes about optimisation and of course the most well known one:

We follow two rules in the matter of optimisation:
Rule 1: Don't do it.
Rule 2: (or experts only). Don't do it yet.

But Bloch doesn't leave it there. He goes on to summarise the rules with "measure performance before and after each optimization attempt." We all know this, but how many of us actually do it?

Actually I've seen these rules put to bad use and Bloch covers that too when he points out that you should still be thinking about performance issues when writing code. The example I've seen is someone retrieving a lookup table from a database for each iteration through a dataset, rather than reading it once and caching it. At least that optimisation was straight forward.

The new information that surprised me a little was that it appear to be accepted that Java does not have a strong performance model. We all know Java is traditionally slow, but i must admit I thought performance had been greatly improved in recent years. Of course the “semantic gap” between what the programmer writes and what the CPU executes is far greater than in traditional programming language.

I almost didn't need to write a summary as the final paragraph of the item summarises it so well.

Item 49: Prefer primitive types to boxed primitives

This is the first item, certainly that I have reviewed, where I feel Bloch has it spot on. There's no arguing with this one!

Bloch points out that Java has a number of primitive types such as int, double and boolean and each of these types has a corresponding reference type: Integer, Double and Boolean. These are the boxed primitives. Auto-boxing and auto-unboxing was introduced into the language in 1.5, so the Java programmer must now be more mindful of their use.

There are three main differences between primitive types and boxed primitives:

  • Primitives have only their values, whereas boxed primitives have identities distinct form their values

  • Primitive types cannot be null, but boxed primitives can

  • Primitive types are more space and time efficient than boxed-primitives

Care must be taken with using the == operator with boxed primitives as, with any other reference type, it compares identity and you almost certainly want to be comparing value. If a boxed primitive is compared to a primitive with the == operator, the primitive type is boxed and the identities compared, so care must also be taken here.

The process of boxing and unboxing, especially in a loop can serious impede performance.

Basically, boxes primitives should be avoided unless primitive types cannot be used, such as in collections or as parameterised types.

Saturday, 26 September 2009

ACCU Conference 2010 Proposal (2): Java Dependency Management with Ivy

Type: case study
Duration: 90 min
Speaker name: Paul Grenyer

Speaker Biography
Paul has been programming in one form or another for over 20 years. After several years using C++ and a brief period using C#, Paul is now happy somewhere he hoped he'd never be, programming in Java.

After time in industries such as marking machinery, direct mail, mobile phones, investment banking and Internet TV, Paul is currently working for an exciting new company based in Norwich where he heads up an ever growing team of senior and highly skilled people.

He has been an ACCU member since 2001, a regular publications contributor, including the now well established Desert Island Books column, creator of the mentored developers and a committee member for most of that time. When he's not programming and family life allows, Paul thoroughly enjoys science fiction, heavy metal and cycling.

Description
One of the biggest advantages of Java is the vast number of third party libraries available. As the size and number of third party libraries used grows your application's disk footprint also grows. The ideal place to put dependencies is in a source control system as part of your project. This means that when you or your continuous integration server check out the project for the first time all the dependencies are just there.

Although, storing the dependencies for a single project in a source control system isn't too bad, if you have more than one project using the same or similar sets of dependencies the amount of space taken up in the source control system starts to get a bit ridiculous. And then when a new version of a library comes out and you upgrade, even more space is wasted as the differences between binary jars cannot be detected, so the entire JAR must be replaced.

In this session I will demonstrate how easy it is to integrate Ivy with Ant and Eclipse and use a couple of XML files to manage dependencies without the need to check large numbers of JARs into source control. You will also see how to setup a local repository for any proprietary libraries or versions of libraries not in the publicly available repositories.

Saturday, 22 August 2009

Bloodstock 2009

This year was one of the best Bloodstocks ever, which surprised me as the line up didn't look too strong. I haven't come away with a list of bands I want to buy all the albums of, but I did enjoy a lot of the performances.

Insomnium[6] sound a lot like Swallow the Sun and Paradise Lost. They put on a very good show. I find a lot of old thrash bands quite boring, but Sodom[5] were quite good. They could have done with a second guitarist and the bass broke in the first song and it seemed to take ages to get it fixed. Saxon[8] gave us some some classic traditional heavy metal. Solid, as expected. The best bit was, following the guitarist standing on a monitor, Biff Bifford ripped off the sign saying "DO NOT STAND" and showed it to the audience. Once their sound was sorted, Arch Enemy[10] stole the show. They turned out not only to be the best band of the day, but of the festival, but then that's what you'd expect from Arch Enemy. Carcass[4] were very disappointing. They played some stuff from Heartwork, but none of their set had the best sound. Arch Enemy should have been on last.

Just like all the other folk/battle metal bands Battlelore[3] were, bland and rubbish which was not helped by the poor PA setup. Wolf[7] were much better than last time I saw them at Bloodstock (when they lost sound part way into their set). Still the same old Slayer/Metallica/Maiden wannabes though. With the Haunted [1] I just didn't see the point. To stoner like for me maybe. I haven't seen or kept up with Entombed[7] for ten years or more. They're great. Especially A Damn Deal Done. Lots of fun. Candlemass[2] seemed to play quite well, but are just not my sort of thing. I was hoping Enslaved[5] would be great from the off, but all they really managed was ok. Good fusion of black and death metal, nothing new. Kreator[8] are like Deicide and Like Slayer, only better. Loved it. Band of the day. All I can say about Apocolytica[1] is nice idea, but the only thing that makes this metal is the drummer. I'm sure some love it, but I don't. I wanted not to like Blind Guardian[5] as their Twyst in the Myth album is rubbish, but they weren't too bad. What can I say about Cradle of Filth[4]? They were half an hour late to the stage. They were really loose, but better than the last time I saw them. Then they called it off after Paul A got hit on the back by a gob stopper fired from a catapult bought on stage. Not very metal, especially when Dani Filth had been goading the crowd to throw full drinks rather than empty ones. To be honest if the Bloodstock organisers are going to book a band like Cradle of Filth to festival many of us believe represents true metal, what do they expect? I Hope Cradle of Filth never darken Bloodstock's door again.

Beholder[6] gave us some straight up metal and despite the singers verbal diarrhea Surprisingly good. For Agonyst[9] I was in a tent full of familiar faces from the Marquee in Norwich, including Louis Coates on the stage. Totally superb progressive death metal with a great sense of humour. Girlschool [4] were disappointing, but then they probably weren't good musicians 30 years ago either. Equilibrium[8] are a great band! They want to be death, folk, black and battle metal, but I like it! Anathema[9]: Wow! Another band I haven't kept up with for 10 years. Opened with my favourite song and did a stonking set of old stuff. With Martin Powel (ex My Dying Bride, ex Cradle of Filth) and one of my favourite and best drummers in the work, Nick Barker (ex Cradle of Filth, ex Dimmu Borgir) on drums and finishing with an iron maiden cover of Phantom of the Opera, Anathema are the second band of the festival. Wish I'd kept up with them over the years now. Turisas [6] weren't quite as good as expected. There was a bit more music and less larking about this time though. Good entertainment none the less. Moonspell[8] were very good as expected. Just wish I knew more of their stuff better. Amon Amarth[9]: Death Metal! Wow! As good as expected. Loved it. I was a Viking for an hour. Satyricon were very enjoyable to watch, but they've only really got one sound, not that it's a bad one. I enjoyed them more at the last Download. The singer is a great entertainer. Europe [5] didn't have a good sound, at least where we were standing. The bass swamped everything. I did wonder if maybe they'd turned it all up to try and feel heavier to a metal audience. Joey Tempest always proclaims John Norum as a guitar god and he just isn't that good. I was horribly disappointed as prior to today I rated them as the second best live show I'd ever seen (after Wasp performing the Crimson Idol and closely followed by Roger Waters, Pink Floyd, The Mission in 1995 and Fish performing all of Misplaced Childhood). I'm hoping bloodstock get a decent headliner next year after three duff ones this year.

There's rumours of Threshold playing again next year. I suspect the best they can hope for is a special guests slot, but even that is unlikely. If they play it'll just be superb. The organisers need to look at the tshirts people are wearing. I'd love to see Lamb of God, Deicide, Behemoth, Vader, Nile, Hypocrisy. Cradle of Filth and Europe just aren't what Bloodstock is about.

Century Rain


by Alistair Reynolds (978-0575076914)

Alistair Reynolds is still by far my favourite author and he never fails to amaze and surprise me. I've said it before, and I'm sure I'll say it again, but nothing else he's written, for me, gets anywhere near as good as his Revelation Space series. I'm sure it's just the lack of scope of a stand alone novel compared to a series.

I enjoyed Century Rain, but I don't think I'll read it again. The ending was rather cliché and I think I'd rather have seen the bad guys win for a change, although it wasn't clear to me when they were trying to wipe out the ALS, I probably missed it somewhere. This book is a lot easier to follow than the Revelation Space novels.

In a few books time I'll be reading House of Suns. Hopefully this will live up to Revelation Space.

Sunday, 2 August 2009

ACCU Conference 2010 Proposal (1): Enterprise Web Application Development in Java with AJAX and ORMs

Type: case study
Duration: 90 min
Speaker name: Paul Grenyer

Speaker biography
Paul has been programming in one form or another for over 20 years. After several years using C++ and a brief period using C#, Paul is now happy somewhere he hoped he'd never be, programming in Java.

After time in industries such as marking machinery, direct mail, mobile phones, investment banking and Internet TV, Paul is currently working for an exciting new company based in Norwich where he heads up an ever growing team of senior and highly skilled people.

He has been an ACCU member since 2001, a regular publications contributor, including the now well established Desert Island Books column, creator of the mentored developers and a committee member for most of that time. When he's not programming and family life allows, Paul thoroughly enjoys science fiction, heavy metal and cycling.

Description
Recently Java enterprise web application programming has been leaning towards a more classical J2EE approach. Traditional Java Server Page (JSP) programming, and even libraries such as Struts, are being replaced by new AJAX libraries that make GUI programming more straight forward, robust and easier to unit test.

In this session I will look at what an enterprise web application is and why you should choose an AJAX based library for GUI development over traditional JSP libraries and an Object Relational Mapper (ORM) over traditional JDBC for the Data Access Layer (DAL).

I will look at an AJAX library and an ORM Library and present simple examples of how and where they should be used. I will then look at how to integrate the AJAX library into traditional Spring MVC and how to use Spring Security to authenticate users of the application and secure individual Remote Procedure (RPC) calls made from the client application, running in a browser, to the server.

In the final part of the session I will take a more in-depth look at the ORM library and explain how to use a registry to abstract away Data Access Objects (DAOs) so that the real DAOs can be used in production and integration testing while seamlessly substituting mock objects for unit testing. I will also explain how the tools provided by Spring make integration testing of DAO objects very simple.

Monday, 22 June 2009

Terminator Salvation


Terminator Salvation is a big disappointment. Maybe it's the lack of Arnie (well except for a short scene that was almost certainly superimposed from a previous film) and a story line, but it just didn't feel like a terminator film. It wasn't going anywhere and it never got to the part where John Connor sends Kyle Reese back to save his mother. There is also way too much of a gap in story line since the previous filem. We need more action, more story and more Helena Bonham Carter, please!

It really seems like the Terminator producers are writing perpetual sequels which never actually get anywhere. I was asleep by the end.

Steel Panther


Finally a band that might be able to take over where the Darkness left off. Steel Panther sound enough like Poison, Motley Crue and Def Leppard to be radio friendly (in the US at least) while are heavy enough to get away with calling themselves a metal band and singing about metal.

Musically Steel Panther are great. What lets them down is the lyrical content and it let's them down big time. Death To All But Metal is amusing and genius, but just about every other track on the album is either embarrassing toilet humour or unnecessarily derogatory towards women. It's not big, it's not clever and I'm sure they could do better.

Putting the lyrics aside this album is a great listen and just what the rock genre needs at the moment to combat the current crop of bland rubbish such as the Kaiser Chiefs.

Here's hoping Steel Panther pull it together for their second album and grow up a little.

Effective Java

Item 44: Write doc comments for all exposed API elements

The item does not even attempt to justify or explain it's reasoning. It just states that "If an API is to be usable, it must be documents". This is complete rubbish. A good Java developer can use and API by reading it!

It then the proceeds to make the frankly ludicrous statement "to write maintainable code, you should also write doc comments for most unexported classes, interfaces, constructors, methods and fields." The lack of maintainability of code is most of my problem with this item. Adding comments in the fashion simply duplicates what is already in the code, increasing the maintenance the code required. History dictates that developers are very good at updating and fixing code, but not the associated comments. Good code only has comments where it is necessary to say why and never how.

The item also states that "The doc comment for a method should describe succinctly the contract between the the method and its client." No! That's what the method name and signature should do.

In general, but not always, comments are a bad thing and should be used sparingly. The only time I can see doc comments being a good thing is if you're writing a library for someone else to use where you don't want them to have to look below the public interface.

The remainder of the item describes the details of how to write doc comments.

Monday, 8 June 2009

Pushing Ice


By Alistair Reynolds (978-0575078154)

Having read all of Reynolds' Revelation Space series I was a bit disappointed by Pushing Ice. Obviously there is far less scope in a standalone novel compared to a series, but the story took quite a while to get going and didn't really contain any new science fiction.

The book draws heavily from both the Space Odyssey and Rama series and even steals the "First Ones" concept from Babylon 5.

Reynolds successfully induces a sense wonder and makes you want to read on to find out what's really going. The ending is a little week and there are many questions left unanswered, but the scene is set for two possible sequels. If he writes them, I'll read them!

If you're new to hard science fiction or to Alistair Reynolds then this would be a good place to start.

Sunday, 24 May 2009

Agile Testing: A Practical Guide for Testers and Agile Teams


by Lisa Crispin and Janet Gregory (978-0-321-53446-0)

This book is pretty much what it says on the tin and that's a good thing. Behind all the usual Shiny Happy People Having Fun stuff you usually get in books from the Agile community is some sound, well expressed advice. This isn't just a book for Agile testers. There's a lot of good practical information that all testers should learn. It's a difficult balance to achieve, but I think the use of the word Agile may put of a lot of people who should really be reading this book.

As well as the general practical testing advice the book also covers a lot of fundamental Agile stuff. It sets out some Agile testing principals and discusses the problems a lot of teams have when transitioning to Agile. It's all been written before, but never from a testers perspective, but to be honest it's not that different from the developer perspective.

The book is very hung up on the idea that developers in Agile teams, and indeed testers in or joining Agile teams have difficulty seeing how testers fit in as developers are doing unit testing and therefore the code is supposedly already tested. Personally I feel that anyone who doesn't understand that not everything can be unit tested and see that “independent” testers are vital is probably in the wrong job. The book made me view our owner tester, who does not come from a programming background, in a totally different way. Instead of seeing him as someone who just carries out the manual user interface tests, I now see him as an integrated member of the team who needs to take part when requirements are gathered and should also be writing integration and end-to-end tests as well as maintaining continuous integration. The necessary training has now commenced.

Most of the Agile discussion is at the beginning of the book. The practical stuff comes later and is quite detailed, including most of the sorts of testing, including automated GUI testing, that should be carried out.

I think this book will make most people think differently about testing in a good way.

Friday, 22 May 2009

Tomcat Servlet with Spring Timer

recently had a requirement to write a service, in Java, that monitors a directory and when new files with the correctly formatted name appear, send them to another system. All fairly simple stuff. There are many different ways of writing Java services, but we use Tomcat quite heavily, so rather than investigate another way, I decided to write a Tomcat servlet to act as the service.

I started off by extending GenericServlet and overriding the init and destroy methods to write log messages to standard out. Then I wrote the appropriate web.xml to tell Tomcat about the servlet and wrapped it all up in a war file (basically a zip file with a Tomcat specific directory layout) and deployed it to my local Tomcat installation. I then checked the logs and found the log messages I'd put in the code. Not bad going for twenty minutes work and my first Tomcat servlet written from scratch.

We've been gradually learning about Spring recently and I remembered reading that Spring had timers that would be perfect for polling the directory for files. So I integrated Spring into my servlet, repackaged and redeployed it and then checked the logs to make sure the Spring application context had fired up correctly. It had.

Next I created a Ticker class by implementing the Java TimerTask interface and implementing the run method to write "Tick" to standard out. I then registered the class as a Spring bean and created a Spring ScheduledTimerTask, set the tick interval to one second and created an anonymous TimerFactoryBean. Making the TimerFactoryBean anonymous causes it to be instantiated when the Spring context is started, rather than waiting for an explicit instantiation from code somewhere. So, what should happen is that the ticker should start as soon as the application starts. Sure enough as soon as I repackaged and deployed, "Tick" was written to standard out every second.

It occurred to me that the class extending GenericServlet was redundant. So, not expecting it to work, I removed the class from the servlet and web.xml entirely and repackaged and redeployed. That's when I had my real "Whoah! That's really neat!" moment. To my amazement and joy the ticker started again and kept ticking every second. I already knew Spring and Tomcat worked well together, but having Tomcat start the Spring context without needing a servlet class is pure genius.

It may seem like such a small and simple thing, but creating my first Java service and Spring timer and having them work together in a very simple way was a real revelation for me.

Monday, 18 May 2009

ACCU Conference 2009

Wednesday Keynote: The Birth of Software Craftsmanship by Robert Martin

Brilliant! Simply brilliant! Uncle Bob is an enthusiastic and wonderfully engaging speaker. Through this keynote he chronicled the, now well understood, pitfalls of big upfront design, the emergence of XP and the birth and journey to maturity of Agile. Bob explained how Agile was adopted by business as it is more people focused than XP and how that caused the technical practices that made XP so good to be left behind. He highlighted how we need to reengage with the technical practices moving forward. We should all be using Test Driven Development, Continuous Integration and Pair Programming and Uncle Bob demonstrated why. In 2009 the benefits of using these are measurably several magnitudes greater than not using them. Uncle Bob has also brought out a new back to basics book to help us all remember how to write good code.


Security in Distributed Systems and SOA by Nicolai Josuttis

At previous conferences it has always been very difficult for me to find sessions that are directly related to my everyday work, so Nico's session intrigued me greatly as securing web services is something my team was due to attempt shortly after the conference. Together with joining the ACCU Nico is responsible for kick starting my career. I learnt more about C++ and the standard library from his book than almost any other source. What I learnt, in a very short period of time, allowed me to absolutely trounce a job interview and increase my salary by 30%. So I always try and go to Nico's sessions.

The session was everything I hoped it would be and answered some key questions that had been going around in my mind for some time. Nico took us through the different issues and methods of securing web services and methods of avoiding common denial of service attacks, such as XML bombs.


Measuring the Effect of TDD by Keith Braithwaite

This was another interesting session, but unfortunately some of the maths and detail went over my head. However, the gist was that code that is designed for test and has good test coverage is almost always less complex and "better" than code that does not. Instead of this being just a general feeling, Keith showed how this could actually be measured.


The Model Student Episode II: A Fresh Hell by Richard Harris

Richard Harris is one of the brightest people I know and his command of maths far outstrips my own. I completely failed to follow most of his talk, but it was fun when I got picked on to choose the numbers in the Countdown simulation. The session was full of entertainment and special effects and left me wondering what Richard would do to better it next year.


Keynote: Welcome Crappy Code - The Death of Code Quality by Nicolai Josuttis

I wasn't the only too come away from this presentation wondering if Nico had lost the plot. I must admit I found myself hoping that Nico's German humour had got lost in translation somewhere. The basic message was that we as developers are not given time to write good code, so we should stop worrying about it so much and accept crappy code. The whole way through I was waiting for the punchline that never came.


Thursday Keynote: The Benefits of Abstraction in Patterns by Linda Rising

Linda Rising is obviously very passionate about patterns. She sees them, quite rightly, everywhere. Not just in software engineering. I'm sure there was some very interesting material in her presentation, but unfortunately it was all lost in the delivery which was slow and at times a little boring.


Memory Allocation and Garbage Collection in Java by Angelika Langer

This was another session where I was hoping to learn something that I could apply in my everyday work and I wasn't disappointed at all! Before the session started I was wondering how Angelika was going to fill 90mins with a relatively straight forward and well understood subject like garbage collection in Java. However, she went in a great deal of detail about the Java memory model and how it has evolved, especially with respect to threading. Angelika also covered some of the tools that can be used to see what is happening with memory inside the virtual machine.


Kirk Pepperdine also attended the session and, as always, took over in a few places. However, I think everybody enjoyed and learnt from his interruptions.


Designing for Testability by Sami Vaaraniemi

I've been designing for testability for years and I wanted to go and see if someone else had a different take on it. Unfortunately Sami, ironically a Microsoft employee, was explaining a lot of stuff such as the use of interfaces and the bridge pattern that I've been using a long time. To my dismay, amongst other things, he also advocated having constructors just for testing purposes where a solution that at least called the production constructors as well could have been employed. There was a lot of useful information for the novice here, but a little bit of caution is required.


Friday Keynote: Geeks, Nerds and Other Prejudices by Susan Greenfield

Susan Greenfield's key note was highly enjoyable and entertaining. She looked at the differences between men and women at the brain level and proved, with plenty of humour, that women are no less capable than men at computer science and pointed to the way in which society portrays computer science and computer scientists as the reason few young women choose a career in IT. Of course if this presentation was flipped on its head and became about why men are as good as women at computer science it would have been condemned as sexist!


Boilerplating Database Resource Cleanup by Paul Grenyer

Paul Grenyer was brilliant! Superb! The star of the conference....Well of course I wasn't really and if I had been I certainly wouldn't be bragging about it. I do feel, however, that this was my most successful presentation to date. Not in terms of number of attendees, but due to the new confidence I feel when presenting. It all comes down to preparation and practice. Next year I'm going to do another 90 minute presentation (if they'll have me).


Processors Processors Everywhere, But How Do I Actually Use Them? by Russel Winder

As I have said in the past, I find Russel very entertaining and this was another enjoyable session where Russel demonstrated the performance of a number of different languages (C, C++, Java, Python, etc) in a threaded environment. Unsurprisingly Java didn't do very well compared to C++. Again, I learnt plenty and was able to contribute. This was three hours well spent.


Saturday Keynote: Considerations for Successful Management

Allan has passed over to the dark side and frustratingly is very good at it. During his session he gave a lot of common sense practical advice about managing agile teams and of course plugged his book.


All in all this is probably the most useful ACCU conference I have been too. I learnt a lot of stuff that I have since been able to apply and there's more to come. During the week I was persuaded, not only to edit three issues of CVu but also to join the conference committee, so I am looking forward to helping shape another great conference next year. Roll on 2010 (isn't that the year we made contact?).

Friday, 17 April 2009

Broken Angels


by Richard Morgen (978-0575075504)

Broken Angels may be "the new diamond hard novel from the author of altered carbon", but it isn't anywhere near as good. It's not a bad novel, but I did find it took quite a while to get going. Once it did get going it was much improved.

In life, as well as in books, I like to know what's happening and why. Broken Angels is almost like a description of what's happening, without any explanation of why and I found that frustrating, but it also encouraged me to finish the book. Most events are explained towards the end.

Kovacs changes side a few times and sometimes that can be difficult to understand and follow. The violence and the sex is still there. In fact Morgan has stepped them up slightly.

I will be reading Market Forces at some point in the future, but if that isn't better I will probably let Richard Morgan go by the wayside.

Monday, 13 April 2009

Setting-up GWT-Ext for GWT 1.6 with Eclipse

GWT-Ext is a great set of widgets for the Google Web Toolkit (GWT). At the time of writing the release candidates for GWT 1.6 are out. GWT 1.6 has a different project structure and embedded Java Servlet (Jetty) server. These changes bring the advantage that the project structure can be deployed directly to a Java Servlet server (such as Jetty of TomCat) without having to manually create the WAR directory. A slight disadvantage is that the setup documentation for GWT-EXT is no longer quite right.

Below I describe the steps necessary to create a GWT 1.6 project with eclipse and configure it for GWT-Ext.

  1. Install the Google Plugin for Eclipse (http://code.google.com/eclipse/docs/getting_started.html).
  2. Use the plugin to create simple GWT application:

    1. Select File -> New -> Web Application Project from the Eclipse menu.
    2. In the New Web Application Project wizard, enter a name for your project (e.g. MegaDeth) and a java package name, e.g., com.megadeth.
    3. Take the tick out of the Use Google App Engine tick box.
    4. Click Finish.

  3. To run the application:

    1. Right click it in package explorer and select Run As -> Run Configurations
    2. Put a tick in the Automatically Select Unused Port tickbox.
    3. Click Run to see the default GWT 1.6 application

  4. Download gwtext-2.0.5.zip, unpack it and copy the gwtext.jar to war\WEB-INF\lib in the project directory.
  5. Create a js directory in the war directory of the project.
  6. Download ext-2.0.2.zip, unpack it and copy the contents to the js directory.
  7. Right click on the project in package explorer and select Refresh so that eclipse can see the new jar and js directory.
  8. Add gwtext.jar to the project:

    1. Right click on the project in package explore
    2. Select Properties -> Java Build Path -> Libraries.
    3. Click Add JARs, navigate to gwtext.jar in the project and double click it.
    4. Click OK to close the properties dialog.

  9. In the project's gwt.xml file (e.g. com.megadeth\MegaDeth.gwt.xml) at the hightlight lines below:

    <inherits name='com.google.gwt.user.User'/>
    <inherits name='com.gwtext.GwtExt' />
    ...
    <entry-point class='com.megadeth.client.MegaDeth'/>
    <stylesheet src="../js/ext-2.0.2/resources/css/ext-all.css" />
    <script src="../js/ext-2.0.2/adapter/ext/ext-base.js" />
    <script src="../js/ext-2.0.2/ext-all.js" />

  10. Change the project's entry point (e.g. com.megadeth.client.MegaDeth.java) to the following:

    import com.google.gwt.core.client.EntryPoint;
    import com.google.gwt.user.client.ui.RootPanel;
    import com.gwtext.client.widgets.Panel;

    public class MegaDeth implements EntryPoint
    {
    public void onModuleLoad()
    {
    Panel mainPanel = new Panel();
    mainPanel.setTitle("Hello World!");
    mainPanel.setHeight(300);
    mainPanel.setWidth(500);
    RootPanel.get().add(mainPanel);
    }
    }

  11. Remove the following from the project html file (e.g. war/MegaDeth.html):

    <h1>Web Application Starter Project</h1>

    <table align="center">
    <tr>
    <td colspan="2" style="font-weight:bold;">Please enter your name:</td>
    </tr>
    <tr>
    <td id="nameFieldContainer"></td>
    <td id="sendButtonContainer"></td>
    </tr>
    </table>

  12. Run the application as before to see a GWT-Ext panel.

Wednesday, 25 February 2009

Lacuna Spellbound

Lacuna Coil are one of those bands where I've bought every album only to discover I only really like one of them in it entirety and then odd tracks here and there. The album I like is In a Reverie and the odd tracks I like most are Swamped and Heaven's a Lie from Comalies. Comalies, and indeed Unleashed Memories are good albums, but I get board very quickly and there's nothing to keep my attention. The much anticipated Karamcode was simply rubbish and therefore I didn't play it more than a couple of times.

I've seen Lacuna Coil live three times and every time they were disappointing with little stage presence. They certainly couldn't compete with their genre counterparts Nightwish.

Today I heard the track Spellbound, from the new album on thier MySpace page. Although it's only three and a bit minutes long it gives me hope for the new album, Shallow Life, out in April.

Sunday, 15 February 2009

Bitter Chilli

Readers of this blog could be forgiven for thinking I mostly use it to whinge about poor customer service, but it's happened again.

Charlotte and I went out for Valentines day last night. I'd booked us a table at Sweet Chilli in Norwich. When we got there we discovered that they were only doing set menus at a minimum of £25 a head. This wasn't mentioned when I booked.

Neither Charlotte or I wanted to eat a starter, main and desert, let alone pay over £50 for a meal we couldn't choose. So shortly after our drinks arrived we got up and walked out. I explained the situation and exactly why we were leaving and asked to pay for the drinks, but unsurprisingly I didn't have to pay.

Amazingly we managed to get a table at old faithful, Pizza Express just across the road and we only had to wait about twenty minutes. We couldn't get the table we wanted, but the service was excellent and the food as good as ever.

After a few drinks in the Marquee we had a great night.

Developing a Spring Framework MVC Application

Last night I finished reading Developing a Spring Framework MVC application step-by-step by Thomas Risberg, Rick Evans and Portia Tung. It's excellent. They develop a Spring application almost exactly the way I would with unit tests, separate integration tests that talk to a real database, an abstracted data access layer to allow substituting of mock objects and ant based deployment and manipulation of TomCat.

If you need to develop an MVC Spring application start with Developing a Spring Framework MVC application.

Friday, 13 February 2009

Paul Carrack

My dad and I have been Mike and Mechanics fans since the Living Years and he's been nagging me for a long time to keep an eye out for them player. Alas it seems this is unlikely to happen again, so when Paul Carrack came to the Theatre Royal in Norwich we figured it was the closest we could get. I really didn't expect him to play any Mike and Mechanics songs, as he has his own extensive back catalogue, so we were pleasantly surprised to get Another Cup of Coffee, Cool Runnings, The Living Years and Over My Shoulder.

It was a strange gig. The first half was cut a little short and the band instructed to perform a different closer. Just before the second half it was announced that Mr Carrack was suffering from Influenza and expected his voice to go before the end of the set. We were offered the opportunity to leave and have a full refund from his personal pocket. No one left, Paul's voice did go, but everyone had a great time, especially his keyboard player who too over lead vocals a few times.

The thing is, we'll have to go and see him again now!

Metal Hammer: Defenders of the Faith II (Birmingham)

I've been to a number of gigs in Birmingham, Vader at Edward No 8, Slipknot and Slayer (co-headline) at the National Indoor Arena and Rammstien and Motley Crew at the National Exhibition Centre. I've also spent a good number of new years, including the millennium, in Birmingham with friends. This was my first trip to the Carling Academy and it's a reasonable venue, with a reasonable sound system, but with a whole lot of unnecessarily rude and unfriendly people, a lot of who don't know how to use deodorant and have no respect for the smoking ban. This was not the Birmingham I know. I did however meet some very friendly scousers and a very chatty girl for Leicester who'd lost her friends, her purse and her Nintendo DS!

Unfortunately we missed Five Finger Death Punch, the band I had been looking forward to the most, as we didn't get there in time. I'll be looking out for them touring the UK in the future. Unearth were as expected, not very good.

I felt rather sorry for Dimmu Borgir. This was meant to be a co-headlining with Lamb of God, but Dimmu got a substandard sound check and although they played very well, the sound was dreadful, bar the final two songs. The days when Dimmu Borgir were pretty much my favorite are long gone and I find that even the Black Metal of Emperor and vintage Cradle of Filth no longer hold my attention. Having said that they were good, just like at Bloodstock in the summer.

Just when I'd pretty much decided the reason Dimmu Borgir sounded so bad was due to the PA, Lamb of God came on with an incredible sound. Very sharp and very clear. They play exceptionally well and are a very tight band. Once we'd moved far enough back to not et knocked into every 2 minutes, I thoroughly enjoyed every song. I would travel half way across the country to see them again, but they'd be a welcome Bloodstock headliner in the future. They did the usual stuff about keeping the metal faith and played a number of new songs, all of which sound superb.

The sound man should not go without a mention. I've never seen someone so keen to get the bands to run to time.

Sunday, 8 February 2009

The Road to Recovery


The first step is often the smallest. Yesterday I jacked the front end of my TR up on to axle stands and took the offside front wheel off and sent it off to have the puncture (or it may be a bad seal on the alloys) repaired. It's been a problem pretty much since I've had the car and it's time it was sorted for good. Once I have four functioning tyres I'm ready for the next step: MOT.

As I have no insurance, the garage have kindly said they'll come and pick the car up, MOT it and drop it back to me. It also needs at least an oil and filter change, and probably a new set of plugs and a water change. I'm going to do those myself this time.

My aim is to have the car back on the road at the beginning of May and use it in the six months through to October. That way I only have to tax and insure if for six months, which will be a lot cheaper than the usual twelve, during most of which I'm usually not driving the car.

I'm soon going to have to face the fact that the bodywork, although better than most of the TR7s of it's age, needs some work and the seats need replacing. What I really needs is the time, space and money for a complete strip down and rebuild. And of course if I do that, I'm going to want to fit at least a 4.6 V8, power steering and rear disk brakes. Maybe when the kids have left home....

The only light at the end of the tunnel, as far as the bodywork is concerned, is that a friend of my wife's can do it for me cheap, but without a strip down it's only going to be patching up at best and I still have to find the money.

Wednesday, 4 February 2009

Boiler Plating Database Resource Cleanup in Java confirmed at skills matter

My Boiler Plating Database Resource Cleanup in Java presentation has been confirmed for ACCU London at Skills Matter on Thursday 19th February 2009. It starts at 6.30pm and you can register here: http://skillsmatter.com/event/java-jee/accu-february

Friday, 30 January 2009

Maybe we're not living in a throwaway society?

My Panasonic DMR-E85H DVD HDD recorder start playing up just before Christmas. Every time I switched the mode from HDD to HDD the machine would crash and go into self check/crash cycle. Eventually it would come back on of its own accord. This seems to be a common problem with the model, but there was no clear fix I could find on the Internet. I've had the player near 4 years, so it's done reasonably well for a modern product.

Event though the lure of buying a new DVD HDD record with built in Freeview was very tempting, the £250 price tag wasn't (and I couldn't get one with blue ray), so I took it back to Richer Sounds to get it fixed. Although initially very helpful, they did nothing with the player for a week and told me it would take at least three weeks to be fixed once they'd sent it off. Also, the inspection fee was £35 and the base case fix scenario would be £70. If they couldn't fix I'd have lost £35 and have to buy a new player.

So I collected the machine and took it to Webster Technical Services instead who, ironically, were recommended by Richer Sounds. They only charge £20 for inspection and do everything on site. I had a phone call the next day saying that the player needed a new power IC and a few dry joints seeing to, it would cost a little over £50 and be ready the following week. Skeptical that a power problem would only show itself when going from HDD to DVD mode I agreed to have the repair done. Less that a week later I received a phone call to say it was ready, so I collected and paid for the player it's been functioning properly since.

The only disappointment I have is that I didn't get to buy a new toy, but at least I saved £200.

Underworld: Rise of the Lycans

I really like Kate Beckinsale in leather (or is it rubber?), so I was quite disappointed to find out that she wasn't in the new Underworld prequel. But then there's no reason she would be, it's set before her character is born (luckily a clip from Underworld with Kate in is shown at the end of the film). Rohna Mitra, who plays one of the lead characters Sonja goes some way towards making up for it.

Rise of the Lycans is different from the other films. Underworld and Underworld Evolution almost verged on sci-fi with their modern weapons and fast cars. Rise of the Lycans is set a few hundred years in the past and quite different, but just as good.

I don't think Bill Nighy knows how to put in a bad performance. He's superb and even stronger and more aggressive than in the other films. Micheal Sheen, now even more prominent in the story, puts in a much better performance than in the other films.

The only criticisms I have is that there isn't much of a story line and Viktor is clearly killed at the end and then turns up alive.

Agile Project Management

by Jim Highsmith (978-0321219770)

Agile Project Management (APM) was recommended to me by Allan Kelly, when I wanted to lean more about it and try and get a few pennies to drop. Allan's more than a little bit of an expert on project management and Agile in particular, so I take his recommendations seriously.

It's a good book. I know I say this about a lot of books, but it's probably more verbose than it needs to be. The first two or three chapters are a general discussion about project management and how APM differs and has more to offer.

Chapter 4 to Chapter 8 is a discussion on the principals and practices of APM. This is where the really interesting and informative material is. Given what I've heard about Agile, I was surprised by the fact that being an Agile project manager is a full time job and there is a fair amount of documentation, even if it is mostly to keep external stakeholders happy. What's important is to get the right amount of documentation and that is also made clear in the book. APM also encourages some upfront planning, but again just enough, so that the team has a clear vision of where the project is going. However, even these chapters I felt were verbose.

I feel I understand APM far more than I did before, but that there's still a lot to learn, that is mostly likely to come by doing. Although APM is meant to handle change, it still seems that change has to be controlled within an iteration. I still feel there's something I'm missing there.

Saturday, 24 January 2009

Threshold

Threshold are everything I love abut music. They're everything I look for in a band: drama, passion. big heavy guitars, Gilmour solos, strong vocals that compliment the music like another instrument and layers of keyboards.

Forget Mercury May and even Lennon McCartney, Groom West is the best there is. I've always been a fan of big dramatic rock. Starting with Alice cooper and then progressing to Marillion, Pink Floyd, Dream Theatre, Evegrey and finally Threshold. They beat all the others hands down, even their modern contemporariness such as Stratovarius, Evergrey and Pagan's Mind.

Threshold are a progressive heavy metal band through and through. They're not heavy like Hypocrisy or Deicide, but they're closer to that than they are to Marillion or Pink Floyd. As a guitar writer and player I rate Groom up there with Gilmour and no one on this earth plays or writes for guitar like Gilmour (Knopfler, Clapton, May and Hendrix, although superb, cannot get close in my opinion).

Andrew “Mac” McDermott is a superb singer. I've always loved strong vocals. Until I discovered progressive metal I thought the strong female vocals in bands such as Nightwish and Within Temptation were as good as it could get. I've only seen Threshold with Mac singing once. Shortly before I was going to see them for the second time (having planned a very short honeymoon so that I could be back in time) he left the band to be replaced by original singer Damien Wilson. I have to admit that I was devastated. Mac's vocals are as much a part of the band for me as Carl Groom's guitar playing. The three pre-Mac albums, two of which featured Wilson, are not good albums musically and even less so vocally. However, Damien Wilson has performed superbly on both the occasions I have seen him with Threshold. I'm reserving final judgement until they record a new album with him, but I'd love to see Mac back in the band even more than I'd like to see Fish back in Marillion (even though I love everything Steve Hogarth did with them up until This Strange Engine), Freddie Mercury alive and back in Queen and all the members of Pink Floyd alive and back together (maybe Sebastian Bach back in Skid Row is pushing it?).

I discovered Threshold at the first ever ProgPower UK in 2006. Every band, except the head liners Therion, were new to me and I picked up all of their albums shortly after the gig. Firewind opened and blew everyone, including me, away and I expected them to have the best albums too, but it wasn't so. I spend most of the following year, including a summer working in Munich and an autumn and winter working at Canary Wharf listening to Threshold and not much else. They're that good. At about the same time I discovered Alistair Reynolds and the two go hand in hand and one always reminds me of the other.

Their best album is Critical Mass even though, like all of their albums, it's a bit preachy lyrically in places. The stand out song is Choices, but there isn't a bad song on the album. In fact there isn't a bad song on any album from Clone through to the most recent Dead Reckoning.

Sunday, 18 January 2009

Some things are guaranteed to make you happy....

It's January. My TR7 3.5ltr V8 (~175bhp) DHC (Drop Head Coupé) hasn't been started since September. The battery was flat and so was one of the tyres. Both were easily fixed yesterday and today he just roared into life, starting almost first time (he had to think about it for about 30 seconds). It's just a shame I couldn't drive him anywhere, especially as it's a warm day with clear blue skies.

Next I'd best get that tyre fixed, then an MOT, some tax and some insurance. There's plenty of time to save up and convince the wife before the summer....

Database Resource Cleanup Published in CVu


“...We've got a great selection of material in this issue, from Paul's excellent boiler plating article to...”


My Boiler Plating Database Resource Cleanup – Part I article has been published in the January 2009 (volume 20 issue 6) issue of the ACCU's CVu magazine.

It has a very nice introduction (see above) from the guest editor Faye Williams and even some feedback from a reader, Roger Orr. The icing on the cake would have been my name and picture on the front cover, but hey, you can't have everything. ;-)

Friday, 16 January 2009

Patterns of Enterprise Application Architecture (2)


by Martin Fowler (ISBN: 978-0321127426)

I've now finished reading all the patterns and it all makes very good sense. I am much happier about how I should be separating database code from domain models and it's always reassuring to read about patterns you didn't realise you were already using and to get a name for them.

In places it is heavy going, for someone like me without much formal Enterprise Application development experience. Some of the pattern descriptions are longer and go into more minute detail than are needed.

I was disappointed, as I usually am with pattern books to find that the use of singleton is encouraged, under certain circumstances, with no discussion of the disadvantages.

Martin Fowler is certainly one of my favourite technical anthers. I enjoy his sense of humour and his clear pragmatic approach to explaining things.

Saturday, 10 January 2009

Languages and the art of driving a car

It's no secret that I've been interviewing recently. Non-programmers often ask me what I am looking for and what skills are needed and why I do or don't offer people the positions. Telling them that I'm looking for Java or C# programmers or a DBA is not only an inadequate description, but also doesn't mean very much to them.

Recently I've taken to using the metaphor of learning to drive to describe the people I'm looking for. Lot's of people know the syntax of a programming language. Learning the language syntax is like learning to control a car. Fewer people know how to apply the language well and safely using patterns, best practice idioms, exception safety, etc. Learning to apply a language is like learning to drive a car well, learning to anticipate, knowing the rules of the road and sticking to the speed limit without loosing control. It was surprising how quickly people suddenly understood what I was looking for.

If only learning to use a language well was as easy as learning to drive.

Bedtime Stories

Charlotte and I have just got back from taking Jude to see Bedtime Stories:

Marty Bronson (Jonathan Pryce) who raises his son and daughter on his own has to sell his homey motel to clever Barry Nottingham (Richard Griffiths) who promises to make Marty's son manager, when he's grown up and has proven himself. Nottingham pulls down the motel to raise a pricey hotel. Although grown up, Marty's son Skeeter Bronson (Adam Sandler) works as a janitor and general servant, but unlikely as it seems, he still dreams of becoming the manager. When Nottingham announces a brand-new gigantic hotel project, he makes his future son-in-law, base Kendall (Guy Pierce), manager, shattering Skeeter's dream. At the same time Skeeter's sister Wendy (Courtney Cox) has to leave town for a job interview and asks him to alternate looking after her two children Patrick (Jonathan Morgan Heit) and Bobbi (Laura Ann Kesling) with Wendy's responsible-minded colleague Jill (Keri Russell). He doesn't get along with either Jill or the children, but his easy-goingness loosens them all up and once he starts telling his bedtime stories, the children grow fond of him and begin to bring in their ideas about how the stories should go. When the stories turn out to become true in real life, Skeeter tries to manoeuver the stories into a direction which will make his dream come true, too.

It's sounds horrific and given the other films we've taken Jude to see in the last year (Wall-E, Kung Foo Panda, etc) I feared the worst. I was pleasantly surprised!

The stories that come to life thing has been done so many times before (Jumanji , The Never Ending Story), but this is different and funny, even though there are all the usual underdog makes it big by the skin of his teeth and love interest clichés. We all thoroughly enjoyed it.

Russel Brand was just brilliant and I was really pleased he got the girl at the end. Adam Sandler was more anti-hero than hero though really. I spent most of the film thinking he was a complete arse, but Keri Russell played the perfect love interest.

Looking though the cast list later I was very surprised to find that Aspan (the evil hotel receptionist) was played by Lucy Lawless and had lost a significant amount of weight since her Xena days. She doesn't seem to have aged either and was totally urecognisable. At least in Battle Star Galactica you could clearly hear her distinct voice.

I'd recommend this film to others with children, but I'm not waiting with any anticipation for the sequel.

Friday, 9 January 2009

Abstract vs Abstraction

One of my favorite interview questions is to ask about the object orientation terms inheritance, polymorphism, encapsulation and abstraction. Most people have no problem with inheritance. Polymorphism usually makes people think, but they usually get to overriding which is good enough as I'm not currently interviewing C++ programmers. Most people equate encapsulation to data hiding and then I ask them to explain abstraction and the difference between it and encapsulation.

Almost without fail I get a description of the abstract keyword from Java or C#. So I explain that that abstract is a language feature and abstraction is about designing interfaces. This usually goes down well and we move on. I just find it absolutely astounding that almost every programmer I interview gets confused here.

Saturday, 3 January 2009

Patterns of Enterprise Application Architecture


by Martin Fowler (ISBN: 978-0321127426)

In the next 12 months I am likely to be designing and getting my team to build at least two Enterprise Applications. Although it's now something I realise I have done in the past (although not the way I'm likely to need to do it in the future) I only really became aware of what an Enterprise Application was in the last few days when I started Fowler's Patterns of Enterprise Application Architecture. I've just read Part I and have dropped a small mint in pennies. A lot of the concerns I have about developing the systems are addressed in the book. I've been concerned about all sorts of things such as:
  • Maintaining data integrity when it is accessed concurrently by multiple users
  • Whether services should be stateful or not
  • Strategies for distributing systems
  • Strategies for the client
All of these, and more, are covered by the book. It's a patterns book, so it doesn't give answers or a single way to fix problems. It describes a number of different possible approaches from different angles.

I'm about to start reading Part II of the book, which actually has the patterns.

Brian Goetz's Good Housekeeping Practices

It will have escaped very few readers of my blog, recent articles and conference presentation proposals that Java clean-up is my current obsession (if that's not too strong a word). Those of you who fall into that category should think yourselves lucky you don't have to work with me at the moment, as my team is getting it worse!

My frustration stems from the large amount of Java based material out there that just ignores the issues involved in cleaning up in Java. Maybe it's mindset that says the garbage collector and finalizers will handle everything. Even thought it appears to be well documented that finalizers are not called until garbage collection and then there is no guarantee that they will be called at all, the penny does not seem to drop with a lot of Java programmers, except those of course who have come from a real C++ background.

It's always reassuring to find evidence that other people have been thinking along the same lines as yourself, so I was very grateful when Hubert Matthews was kind enough to point me in the direction of Brian Goetz's Good housekeeping practices article.

Friday, 2 January 2009

Of Laptops and Meetings

"Please, don’t take your laptops to meetings. And if you do leave them powered down." Read more

I couldn't agree more. It's not just meetings, but conference presentations too.