Guus Bosman

software executive and technologist


You are here

Java

Image: 
Java

New release of Java Config

Today version 1.4 of JavaConfig has been released!

The new version is a major milestone. Not because of a lot of functionality -- the amount of changes is relatively small-- but because this is the first release that was created by someone else than me. Rolf Heller, an ex-colleague from Chess, took over the burden and cleaned up and streamlined the release process. Great work, thanks a lot!

So for those of you who have been working with a 1.4-SNAPSHOT so far: go ahead and download the new version. The Ibiblio release should be there in a few days too, for the Maven users.

Visit the JavaConfig homepage.

Java

Java Config

I have been working on a component for Java programs for a while now. It's called "Java Config", and it provides access to configuration data for Java and J2EE applications.

Chess has recently agreed to publish the software under an Open Source license, which is very cool. It can now by used by anybody who needs a component like Java Config (it is published under a BSD license).
A piece of code, just to give an idea of what it does:

  
public class SimpleApplication {
  public static void main(String[] args) {
    String sayingHi =  getConfig().getWelcomeText();    
    boolean yesOrNo = getConfig().getMyFirstBoolean();
    int numberOfDays = getConfig().getNumberOfDays();
    java.net.URL url = getConfig().getNiceWebsite();
  }

  private MyConfig config;

  private static getConfig() {
    if (config == null) {
        config = new MyConfig("my.properties");
        ConfigValidationResult configResult = config.validateConfiguration();
        if (configResult.thereAreErrors()) {
            // display errors here
            System.exit(1);
        }
    } 
    return config;
  }
}
Java

Hibernate, but not Spring

Hibernate logo.Two weeks ago I was starting up a new project, and I wasn't sure if I should introduce the Spring framework. I decided not to. First, the immediate benefits are not clear enough, unlike Hibernate for example, but most of all I didn't want to introduce too many new technologies at once to the development team.

We are using Struts as MVC framework, which is more and more becoming a company standard for web applications, but not everybody on the team has worked with it before. Another new tool for some of the team members is Hibernate. The (existing) database uses stored procedures. It turns out that there are only a few of those and that they're used only for a few specific data insert statements -- not to manage all possible data manipulations. This means there was no data manipulation layer yet and so using Hibernate for the management tool is not a problem.

A last nice feature we're using is a ServletFilter that validates the HTML that we're generating. Not really rocket-science, but a strong and certain way to make sure that the HTML we're creating is standard compliant and valid.

Combined Hibernate and Struts make for a nice and very productive application framework. One of the things I would like to do next time is to look into something to deal with the boiler-plate code that's sometimes necessary for Hibernate. A colleague is looking into Hibernate Synchronizer, but my initial feeling is that a more well known tool such as XDoclet might be a better investment. It's a bit too risky for my taste to build an application on a tool created by single person. His website has been down for a couple of days too -- not a good sign, either.

Java

Spring Framework

At the moment I'm looking at the Spring framework. A couple of books are written about writing Java software using Spring, and at lately I've been reading "Better, Faster, Lighter Java" by Justin Gehtland and Bruce Tate.

The book is interesting. The authors give a refreshing perspective on software development using Java. They describe how many software projects use over-advanced frameworks and tools such as EJBs, even for simple applications. They give suggestions on alternatives, and re-state the advices that have been been formulated since the beginning of computer science, of which rule number one has always been: "Keep it simple."

A nice quote from the book: "Java development without a little heresy would be a dull place, and a dangerous one. You've got to challenge conventional thinking. When you don't, bloat happens."

The Spring framework itself looks promising. Not revolutionary, but useful. I am starting up a new project at my work this week; it's a management tool for an existing application. Unfortunately, it looks like it's going to be difficult to introduce Hibernate or another decent database abstraction layer, as a lot of JDBC/stored procedure code has already been written. To enable a smoother transition later to Hibernate, it's probably wise to define a strict separation between the existing database access code and the new components that my team will make. I'm trying to find out if Spring is able to help out in that aspect.

Java

Eclipse 3.0

Eclipse 3.0 screenshot.This afternoon I took a look at the new version of Eclipse. This is the IDE (software editor) that we are using at Chess, and a few days ago a new version, 3.0, has been released.

I have already worked with beta-versions of 3.0, so-called milestone releases, so I knew what to expect. Still, it is pleasant that there is an official new release, because they usually more stable and mature. This means they are usable as project-standard; I'll introduce it in a new project that starts after my holiday.

Some features that I personally like a lot are code folding, background processing, "create constructor from fields" and the fact that refactoring now also fully takes JavaDoc tags into account.

Java

SCEA part I: multiple choice

This afternoon I did the multiple choice test for the SCEA certificate (Sun Certified Enterprise Architect), and I passed it. My score was 83% this time, which is lower than the previous time but I am still quite satisfied with it.

The test center in Haarlem where I did a another test moved to Amstelveen, so I went to a test center in Amsterdam, in the Aristo building.

I am currently in Kilroy, a travel agency in Amsterdam, where I´ll pick up my ticket. I´m going to the States in a week! Sasha and I are going on holiday together... to Florida! It´s a really nice thought -- Florida will be great and seeing Sasha again will be even better.

The computer in the travel agency broke down, so I´ll probably be here a little longer. That´s fine, the German Institute is near here and I´m very early.

Java

SCEA, part I

Books I'm studying from.I am preparing for a Java exam I want to do. The certificate is called "Sun Certified Architect for J2EE", and it's my goal to get it in the next two months.

The exam consists of three parts. The first part, which I'm studying now, is a theoretical exam. It is not very difficult, because it deals with things I often work with. It is interesting to read all the theory again, and also to learn the vocabulary by hard. This makes communicating ideas with others much easier. Today I've been studying all day on it, and tomorrow I'll continue.

I hope to do the test for part one in the beginning of June, after the deadline of my current project.

Java

Tomcat clustering

Tomcat Clustering. Image (c) OnJava.comToday I've been working a nice Java project, just for fun. It's been quite a while since I had time to do that; I've been quite busy the last few weekends.

I looked into a feature of the new Tomcat, a servlet container that I often use at my work. I've been working with version 5 for a while now, but one of the new things I didn't try yet was clustering. This is a mechanism to provide more up-time and better scalability in a web-application.

Today I set up a few instances of Tomcat at my desktop, and experimented with and read about the clustering and load balancing features of this open source server.

I found two nice articles on OnJava.com about this ([1], [2]) that were very helpful to provide a quick start. The experiment went quite well; the hardest aspect was to configure a multicasting IP address.

It's nice to see 'little' Tomcat start to support features that its bigger brothers have had for a long time. However, I feel that it's mainly useful for testing purposes and as a development tool. If your website is big enough to warrant clustering, you'd probably want to go for a commercial tool such as WebSphere or WebLogic, if only for the support contract.

Java

New software

I'm looking for new software to use on my server. I like the program I'm using now (Php-Nuke), but it's limited in many aspects and not very secure. Next to that I would like to use a Java based program. It's always good to have experience with different products.

I looked at a number of products so far. First I tried Jahia: very beautiful, very well designed, but too big and slow and not open source. SnipSnap: well designed, quick, nice technology but not a lot of features. Jlscp: too small userbase, too much under development.

Now I'm installing a Dutch product, MMBase. It's a famous name, but the first results aren't very promising; the installation is rather troublesome.

Java

Sun Certified Java Programmer

All right -- I won't keep you waiting any longer... I made it. It would have been a big disgrace if I didn't, after all these years programming, but I'm happy with the result. There were 61 questions and my score was 90%. For the programmers, what is the result of this code when run?

class Test {
  public static void main(String args[]) {
    int i = 1, j = 0;
    switch (i) {
      case 4: j += 6;
      case 2: j += 3;
      default: j += 2;
      case 0: j += 4;
    }
    System.out.println("j = " + j);
  }
}

It's not a very prestigious certification, but I'm happy I did it. It forced me to study many details of the language I had never studied before. I found that quite useful. Now it's up to the next one, which will be much more difficult.

Pages

Recent comments

Recently read

Books I've recently read: