Ini files and Apache Commons Configuration


Trashing old software

Trashing old software

The project I’m currently working on uses a simplistic object store for persistence.  The original authors, in their collective wisdom, decided that whenever something needed to be saved they would save it to a hashtable, and use Java serialization to save that to a file.

In a way I can see why they did. It’s a quick way of getting a simple to use object store.  The project has been through several revisions since, but the data store stayed the same.  It should have been replaced with something more robust a long time ago.  I’ll explain more after the jump …

Continue reading

Swaying the Team to Innovate.


Innovation in Corporate America

Innovation in Corporate America

As I mentioned in Between a Rock and a Hard Place, our team is currently on the horns of a dilemma.  I likened our situation to racing on a flat tyre.  Do you stop and fix, taking the hit of lost time, or do you make a best effort to keep pace, almost blindly disregarding the situation.

I’ve just finished reading Sway (Brafman & Brafman, 2008).  It offers some additional insights into our situation.  For example, all my engineering training has been around technology.  How computers work, how software works, how to create good software, how software design works, how the software process works, etc.  As far as I remember, no time was given to group dynamics.  Since most non-trivial software requires a team to collaborate, one would think that taking the group into account would factor into software design and engineering.
Continue reading

The Perfect Build Setup – Hudson


Introduction.

I have had a passing acquaintance with Hudson for some time, but it is only recently that I’ve had to get down and dirty with it.  For one reason or another, much of the build infrastructure work for my current project has fallen on me.  This has allowed me to become much more involved with Hudson on a daily basis, and I have to say I’m loving it.

Hudson is a continuous integration environment.  We have configured it to check code out of our subversion repository on a regular basis, run the build scripts, gather the cobertura code coverage, junit test reports, findbugs reports, etc., and have these metrics published and trended over time.  I think I can speak for my team when I say, we’ve found it a boon to be able to regularly build our system in a clean environment, and gain such insight into our code quality.

So without further ado, I present instructions to allow you to set your own build system up in 20 minutes or less.
Continue reading

Design Patterns


Introduction to Design Patterns

Within each engineering discipline, engineers have found that when analysing problems, similar types of sub-problems would tend to recur from time to time.  Having had experience from previous project work, they knew that a similar solutions to those problems could be reused.  This became the basis for design patterns.
Continue reading

Getting Subversion Revision in Ant



Here’s a nifty Ant snippet. This can be used to get the Subversion revision number from your Ant build system. Using this, you can label your build artefacts, providing better visibility on what exactly is contained in each build.

<target name="find_revision" description="Sets property 'revision.number' to the head svn revision">
        <property name="revision" value="HEAD"/>

        <!-- find out revision number of HEAD, need svn.exe installed on local machine -->
        <exec executable="svn" outputproperty="svnlog.out">
            <arg line="log ${homedir}/.. -r ${revision} -q"/>
        </exec>

        <echo>${svnlog.out}</echo>

        <!-- need ant-contrib.jar for this in lib dir of ant install -->
        <taskdef resource="net/sf/antcontrib/antcontrib.properties"/>
        <propertyregex property="revision.number" input="${svnlog.out}" select="\1">
            <regexp pattern="r([0-9]*)"/>
        </propertyregex>

        <echo>Revision found: ${revision.number}</echo>
    </target>