Archive

Archive for January, 2005

“Hibernate Quickly” In Production

January 31st, 2005

As some of you know, Manning has contracted Patrick Peak and me to write a companion volumn to King and Bauer’s “Hibernate In Action.” I’m pleased to announce that our book, “Hibernate Quickly,” will be going into production this week.

What does the production process entail? Technical and copy editing mostly, followed by production editing. I’m not entirely clear what production editing is, but the short answer is that the entire production process takes about 3 months.

“Hibernate Quickly” is about 240-260 pages in length, and includes practical information and advice from two people that have used Hibernate on numerous projects. We also discuss integration with Spring, XDoclet and a few popular web frameworks.

For those of you thinking about writing a techical book, let me caution you that it’s far more work that I thought it would be. Writing can be extremely difficult, especially when you consider that you’re creating a product for the publisher to sell, so if you have strong opinions on your creativity, you’re probably going to be disillusioned.

That said, writing is a very rewarding process, and it does get easier the more you do it.

nick Uncategorized

Debugger Challenged

January 27th, 2005

Decent Java debuggers have been available for years. My weapon of choice, IDEA, even has one. Many developers swear by debuggers for quickly getting to the bottom of a pesky problem, but I can’t seem to get my head around developing with them.

Instead of using debuggers, I’ve always used logging or unit tests to vet out any problems in code. I prefer logging and testing because they’re reproducible by other developers on the team, while a debugging session can be difficult to reproduce, depending on what you’ve stepped over.

The problem with unit testing and logging is you have to know what you’re looking for. If you have unit tests and still have bugs, it can be argued that your tests weren’t thorough enough. You either need to write more tests and add more logging statements, or step into it with a debugger.

nick Uncategorized

Differences Between Two Databases

January 25th, 2005

When you’re developing, you often need to migrate changes in a development database schema to a legacy schema. Making the changes by hand can be tedious at best, and a complete nightmare at worst. I’ve written a small utility to make creating an update script a much easier.

The process isn’t rocket science. I create a tree of objects representing the tables, columns and indexes contained in the database and diff the two structures. It’s not ready for primetime, but I’m hoping that I can improve it to release quality over the coming weeks.

This isn’t a new idea. There are preexisting tools, but I couldn’t find anything I liked in Java. If you know of something that’s fairly robust, let me know.

nick Uncategorized

Shale Graduates

January 23rd, 2005

A lot of speculation has surrounded the development of Shale, a new project developed originally by Craig McClanahan. Some of that speculation has been put to rest with the official adoption of Shale as a Struts subproject. This doesn’t mean guarantee Shale will be the basis for Struts 2.x, but I personally think it’s likely.

If you’d like to read more on Shale, there is some information on the Struts Wiki.

nick Uncategorized

Adopting RUP

January 21st, 2005

With our client projects increasing in duration and complexity, I’ve found a need to adopt some process to guide our development. After looking at the buffet-line of software development processes, I’ve settled on the Rational Unified Process. RUP was the chosen since it combines aspects of agile development, is comparatively low on ceremony and is customizable for the organization.

The informal process we’ve used in the past could be described as “XP-like,” but I’m not necessarily a fan of XP. It just seems to be a lot of kool-aid and hand-waving. Instead, we used some of the ideas that XP has repackaged and claimed as its own. (I’m sure the XP zealots will be buring me in effigy shortly.)

I feel that we need to move away from ad hoc processes and migrate to something with a bit more formality. Some developers may scoff at the idea of voluntarily encumbering themselves with process, but I think it will allow us to deliver better products to the client. Happier clients mean more projects.

We’ll be using RUP on an upcoming project and I’m interested to see how it helps or hurts us. I’m curious to know what processes any readers have used for small development teams, and what results you’ve had. Would you change the process, or replace it with something else?

nick Uncategorized

Training & Jobs

January 17th, 2005

Just finished a short training project with Iconic, in Ann Arbor, Michigan. For a training session, it was pretty informal. Since the team was familiar with Java, we just worked on implementing a few simple use cases for their upcoming project with Struts and Hibernate.

I didn’t get to use any of my new Keynote presentations, but that’s okay because I’d rather do on-the-job training over formal presentations any day.

The people at Iconic are looking for Struts programmers in the Ann Arbor, Michigan area to work on a short-term project with the potentional for a long-term engagement. If you or anyone you know is interested, post a comment and I’ll forward it along. (All comments are moderated and your information will remain private.)

nick Uncategorized

Fresh docs (finally!)

January 10th, 2005

After some prodding from the xdoclet-user list, I’ve finally written some documentation on the DynaForm functionality in the Struts XDoclet module. You can get it here.

nick Uncategorized

DHTML woes with Internet Explorer

January 10th, 2005

Internet Explorer seems to have difficulty telling the difference between the ID and NAME attributes of HTML tags. For instance, if you have two tags in your page like the following, you will have problems when retrieving the element using the getElementById(String) DOM method:

<input name=”firstName” type=”text” onblur=”validate(this, ‘firstName’);”/>



<span id=”firstName” class=”inline-error”>First Name is required</span>

Let’s assume we want to do something reasonably interesting, like validate the firstName field and display the message in the if it’s not valid. We’ll display it by changing the style from “hidden” to “visible”:

function validate(e, msg) {
  if (e.value == ”) {
    document.getElementById(msg).style.visibility=’visible’;
    e.focus();
  }
  else {
    document.getElementById(msg).style.visibility=’hidden’;
  }
}

Guess what happens when the field is valid? The text field disappears! You have to make sure your tags have IDs that differ from the NAMEs of other elements. It’s possible that I missed something in the spec, but this code works fine on Firefox.

nick Uncategorized

Struts Plugin for XDoclet2

January 9th, 2005

It’ll be quite a shock for most people to learn that XDoclet2 isn’t dead. In fact, Konstantin has just released the Struts plugin for it. It doesn’t look like there’s an official release yet, but you can always get it from CVS.

I haven’t done an in-depth review of the plugin, but it looks like it includes everything from the XDoclet 1 Struts module.

nick Uncategorized

Working with Keynote

January 9th, 2005

A growing number of our short-term client projects have revolved around developer training. While we mostly train on Struts and Hibernate, occasionally we’ll be asked to train in-house developers on something unique, such as developing applications for a digital set-top box.

Training typically starts out with a series of slides, created in Powerpoint. After tiring of fighting with PP, I’ve decided to switch to Keynote. So far, I’ve been rather impressed. It was able to import my PP stuff without complaint and is much more usable than PP.

I should have made the switch sooner, but I had Powerpoint from the Office bundle and couldn’t immediately justify 99USD for Keynote. I’m optimistic that I won’t be so thick-headed in the future.

nick Uncategorized

Backups with hdup

January 5th, 2005

My backup needs are fairly basic. Monthly/weekly/daily, and transferring files to remote servers. Unfortunately, I’m too lazy to write the shell scripts myself and a number of the backup utilities I found were either overkill or just too weird to use. (Yes, ‘weird’ is a technical term.) Then I found hdup.

As a backup tool, hdup is pretty simple. A single INI file and a few crontab entries and you’re off and running. SSH is used to transfer backups, and GPG encryption of archives is supported. It will also chunk the archives to burn them to a CD. There are a few other features, but I don’t use them.

The only thing that’s somewhat annoying about hdup is you have to put ‘.nobackup’ files in each directory you don’t want backed up. You can also exclude files in the INI file, if that’s your thing.

Of course, you don’t have to backup anything. It’s totally up to you.

nick Uncategorized