Best Practices For JNI

Wish I'd had this a few years back: Best practices for using the Java Native Interface.

Might have saved me some grief.

Tags: Java, Tools


My spidey-sense tells me that this is potentially important:

Hi all,

I'm pleased to announce the release of Gaelyk, a lightweight Groovy
toolkit for Google App Engine:

Gaelyk builds upon the Groovy templates and Groovlets, adding some
additional hooks into Google App Engine SDK APIs thanks to new
variables in the binding and with a Groovy category.
Gaelyk is mainly intended for small apps, as Grails is a better fit
for bigger projects, but for quick little apps where you don't need
the full power and conventions of Grails, Gaelyk can be used.
You can learn more about Gaelyk by visiting the website, and reading
the tutorial:


Guillaume Laforge
Groovy Project Manager
Head of Groovy Development at SpringSource

I looked at it and straight-away thought: "At last. Something for the PHP/GCI people!"

Gaelyk offers little or no ceremony and little or no scary sophistication. Plain Good Stuff with the extra cachet of Google AppEngine thrown in for good measure.

Hopefully, it will be a great "gateway drug" to get people into Grails.

This is really delivering on the potential of Groovy!

Congratulations, Guillaume and Marcel.

Tags: Grails, Programming

A Quick Overview

I prepared this recently for a local organization. May as well share and enjoy:

Bob Brown

Principal, Director and Owner of Transentia Pty. Ltd.

Transentia Pty. Ltd.

Brief background of yourself / company
Bob Brown has 25 years experience as a software developer and also possesses more than 10 years experience in tertiary-level research and lecturing in Europe, Asia and Australia. Bob has been a frequent presenter at conferences and public events throughout the world.

Transentia has been in existence since late 1999 and operates under the byline "training, development, consulting at the leading-edge of technology."

Transentia's direct client list includes:

  • Energex/SPARQ
  • Oracle
  • Support Technologies
  • Queensland Treasury Corporation
  • DHL
  • BEA
  • SMS Consulting
  • Queensland University of Technology
  • Tasmania Police Department
  • Software Engineering Australia
  • CoalTech Pty. Ltd.
  • The Northern Territory's Department of Education
  • University of Macau Centre for Continuing Education and Special Programmes

Transentia has also subcontracted on behalf of many other companies to many other large Australian organisations.

Specialities / Special interests
Bob Brown is a specialist in Enterprise-level Java Development, covering:

  • JEE (with BEA/Oracle Weblogic, and JBoss)
  • The Spring Framework and associated modules and sub-projects
  • The GR8 technologies (Groovy/Grails/Griffon)
  • Systems integration with vendor-level products such as BEA Weblogic Itegration, BEA Liquid Data, Spring Integration, Apache Camel; also with 'raw' technologies such as SOAP/REST WebServices, CORBA, DCE and Java RMI
  • The JBoss Seam Framework
  • Rich Desktop/Internet Applications
  • Applications of XML (such as Scalable Vector Graphics [SVG])

Bob also has strong C development experience in embedded/SCADA environments.

Bob has extensive Unix/Linux experience.

Bob has varied experience as technical project team lead and is a Certified Scrum Master (http://www.scrumalli … iles/45966-bob-brown).

In 1998, Bob was the recipient of an IBM 'residency' and was sponsored to work at IBM's Austin, Texas, research centre on Java design, programming and optimisation for the Network Computer. This work has been published as a Prentice-Hall book entitled "JAVA Thin-Client Programming for a Network Computing Environment." In April 2000, he was asked to return to IBM for a second residency entitled "Connecting e-business to the enterprise." This residency concentrated on using IBM's Pattern Development Kit to integrate IBM's WebSphere Application Server, VisualAge for Java, CICS, IMS and MQSeries into an Internet-based e-business enterprise.

Bob holds an M.Sc. from the University of Essex, England and a B.Sc. from The Hatfield Polytechnic, England.

Global Financial Crisis

From the humour page of the June-July edition of the Business Trader Magazine's website:

As the person who brought this to my attention (thanks Janet!) said: Is there a profound economic phenomenon lying within?

It wouldn't surprise me to find that the people who brought us the various "stimulus packages" read this before coming up with their brilliant ideas…

Tags: Rant

Sales, Cleaning and IT

Nice to know where my industry stands.

I remember being told years ago that while the boot making industry has an ANZSIC code (2250), the ICT industry does not.

Given that even boot manufacturing would depend on ICT's ministrations, this is rather sad…

That is if the industry even still exists in Australia…my home city in the UK was once renowned for its shoemaking; there are none left today, excepting that the soccer team are called 'The Cobblers.'

Tags: Rant

Barcamp Brisbane III: The Search for Flock

Yesterday, I attended this event: similar to CITCON but with a wider "anything goes" feel.

My thanks to everybody who attended and especially to those who presented, I learned some Good Stuff.

Good Stuff like:

  • the acquia Drupal 'distro' and the aegir hosting system for Drupal sites
  • what I am doing wrong with Git! Thanks aussiegeek!
  • what is good about the fish shell
  •, "the zooming editor for stunning presentations" presented by my old (read: in times of yore, not aged) colleague @mrees.
  • an excellent discussion/forum on why Agile does not mean "no documentation."

Most of this stuff is outside my normal sphere of influence, so this was a truly mind-opening experience :-)

I did a couple of informal stand-ups about Grails. Shame that I didn't have a projector (or rather, that I had a digital PC port and only an Analog projector cable available)…made it rather hard to show code.

No twitter for me, but I do have an equally inane piccy or two:

There's lots more 'stuff' out there, search for #barcampbne.

Tags: Griffon, Groovy, Programming

Configuring Reference Data In Grails

Dealing with reference data…the predominantly static data that populates drop-down lists, and so on…always causes wasted brain cycles: for ease of maintenance, we don't want the values embedded in the code, but we nonetheless do want it centralized.

The Spring underpinnings of Grails (and the way that Grails 'surfaces' these underpinnings) can offer one solution and help reserve those brain cycles for more deep thoughts.

Here's a typical example of reference data; the drop-down select car and things lists in this trivial GSP:

<%@ page contentType="text/html;charset=UTF-8" %>
  <head><title>Reference Data Demo</title></head>
    <h1>Tell me about yourself</h1>
    <table cellpadding="10" cellspacing="2" border="0">
        <td><label for="car">Select your preferred car:</label>
        <td><g:select name="car" optionKey="key" optionValue="value" from="${cars.entrySet()}" />

        <td><label for="things">Select your preferred things:</label>
        <td><g:select name="things" optionKey="key" from="${things.entrySet()}" valueMessagePrefix='things' />

Something I learned recently and show above: for HTML: "The TR or table row element requires a start tag, but the end tag can always be left out." I always assumed that these 'container' tags had to have both start and end tags. Be warned, however: although a handy shortcut, this creates a document that will not be legal XHTML [which is always best aimed for]. Thus, this falls into the set of "useful tricks and tips that are best ignored for one's own sanity." Other members of the set include PERL, and the tactics that could be used for winning an argument against my wife…

The above GSP showed how to use the reference data but how is it declared? I simply declared the following in Grails' conf/resources.groovy file:

beans = {
    cars(java.util.HashMap, [slow: 'Toyota Avalon',
      fast: 'Bugatti Veyron'])

A more traditional 'Springy' approach is also possible via conf/resources.xml:

<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns=""

    <util:map id="things">
        <entry key="good" value="good"/>
        <entry key="bad" value="bad" />


Both configuration options can be (and are, in this example) used together.

In both of the above cases, the data is now centralized and separated from the body of the code. Both Good Things.

The second <g:select> shows how to internationalize this feature.

In this case, the value in the things map is used (in conjunction with the valueMessagePrefix attribute value) as a key into the 'messages' resource bundle under grails-app/i18n.

For this example, the bundle contains entries such as:

things.good=My Cat
things.bad=The Flu

Sadly, there is a bit of a bug here. It does not currently (Grails 1.2-M1 and below, at least) appear possible to use both valueMessagePrefix and optionValue attributes. In this case I have been been lucky and have been able to get away with omitting the optionValue attribute (but the optionKey attribute is still required):

<g:select name="things" optionKey="key" from="${things.entrySet()}" valueMessagePrefix='things' />

In other situations (with collections of other bean classes), one may not be so lucky.

My AUD$0.02 worth on the bug is attached to: http://jira.codehaus … g/browse/GRAILS-3961.

For completeness (its pretty trivial) here's the controller code:

class ThingController {

  def cars
  def things

  def index = { redirect(action: view) }

  def view = {
    [cars: cars, things: things]

Notice the way the two Reference Data Maps are injected into the controller and then pased into the view as its model…clean and simple.

It is possible to do the same sort of thing with filters. This can be useful for showing build numbers, etc. on page headers/footers.

Here's what it all looks like pulled together (pretty ordinary, but that isn't the point):

Now. Stop wasting brain cycles on JNDI entries/Properties files/Database entries/Quartz timers/… and get on with more important things.

Tags: Grails, Programming

My Volley In The Browser War

I'm using the latest snapshots of Opera 10 more and more…and enjoying it!


Microsoft: start worrying.

Tags: Rant

Another Interestesting InfoQ Agile Discussion Roundup

This time Coping with Bugs on an Agile/Scrum Project.

One comment that that resonated with me stressed how important it is to characterize changes differently from actual bugs. Having the Product Owner tell you "We forgot about X" does not actually mean that a bug has crawled into the system.

Tags: Agile

JPA Implementation Patterns

A useful blog series: … ementation-patterns/.

I'm sure that this will be useful sometime in the future.

Tags: Java, Tools