Posts

Showing posts from 2008

Gradle First Look

I have put the Groovy based build system Gradle into use for a first project. The project is a deployable jar. This is intentionally the simplest form of project that you can build. I did not want to attempt anything larger given how difficult builds can be.

Gradle seems to have more in common with Maven than Ant. It has a more structured dependency management system than Ant using Ivy and it has a concept of plugins that implement packages of tasks that are designed to work together.

After a short time together, these are my thoughts:
Pros
Absolutely minimal configuration to get a build goingCompact Groovy syntax for depency resolutionDecent documentationTruly scriptable like Ant or early Maven (even though Jelly was a hideous thing)Big plans (let's hope they follow through)
Cons
Error messages are pretty unclear at the moment.
It doesn't yet feel 'intuitive' to useYoung project and many of the built-ins in Maven are not there yet: Cobertura, PMD, etc...So far, the bigg…

A Groovy ZK Builder

I have built a Groovy builder for the ZK tool set.

Motivation
While using ZK with Grails, I found that I was using a lot of Java object building inside of ZK Composer objects. This leads to a profusion of code like the following:


Listbox lb = new Listbox();
Listhead lh = new Listhead();
lh.setParent(lb);
Listheader idHeader = new Listheader('id');
Listheader nameHeader = new Listheader('name');
idheader.setParent(lh);
nameHeader.setParent(lh);

And as XML

<listbox>
<listhead>
<listheader label="id">
<listheader label="name">
</listhead>
</listbox>


As you can see there is a profusion of boilerplate code that is the hallmark of a nested Java API. The XML is easier on the eye and hides setting parent references. What I really wanted was something like the simplicity of the XML with the flexibility inherent in Groovy closures.

Groovy ZkBuilder
The builder's syntax is very similar to the XML.


ZkBuilder zk = new ZkBuilder()
Window w = …

Starting a New Java Project is Deplorable

As I have recently decided to seek new employment, I have begun reintroducing myself with several of the key Java libraries. I have been asked for my experience with Spring, Struts, Hibernate, EJBs (3.0), JSP, HTML, and AJAX. With the exception of Spring and AJAX, I have experience with all of these tools and frameworks. Unfortunately, all of the APIs move. So, I need to do a simple refresher.

This turns out to be immensly difficult where Java is concerned. I find it is best to use a project to learn the ins and outs of a given technology. A project in java requires a lot of scaffolding to get going: build scripts, test runner, deployment scripts, etc. This inevitibly leads to using Maven 2 combined with it's archetype plugin.  Which, for reasons that escape me, always leads to a project that is 90% the way to a usable build.  
What I really want is a project that is immediately useful with a packaged set of best practice tools to learn the tech.  It seems to me that the peo…