Brad Lucas

Programming, Clojure and other interests

Code In The Constructor (Anti-Pattern)

June 21, 2006

I recently saw a programmer at a client site developing a small test app. For reasons that didn’t become clearer till later, this person has developed their application in such a way that it did all it’s processing in the class constructor.

When I first saw this I was a bit dumbfounded. The class had a main so the it could run from the command-line. the main method for this class looked like the following.

public static void main(String[] args)
       CodeInConstructor c = new CodeInConstructor();
}

So we have a class who’s Constructor has a side-effect of actually doing the work the class is meant to perform. Strange.

Continue reading →

Pattern For Laying Out Cvs Trees For Java Projects

June 21, 2006

Once you start working with others on larger Java projects you will require a logical CVS tree to store and share project artifacts among each of the team members.

With this it should go without saying that you need to start designing your applications with a sound package structure.

These two activities can conflict due to the nature of how each project contains Java sources in a directory structure to match the package structure. To make this clear start two Java projects that contain sources for the com.mycompany.database project. If you do this you’ll see that there isn’t a way to prevent collisions in names because each project is using the same package name.

Solution

Continue reading →

David S. Ware At Vision Festival Xi

June 19, 2006

Managed to get to Vision Festival XI (http://www.visionfestival.org) for the last set of the last night of the festival. If you haven’t seen David S. Ware in person it is definately worth it. I’ve never heard anyone play a saxophone with such power.

 According to the Vision Festival notes it was the Ware Quartet’s final US Performance. I wonder what his planned next. Nothing was mentioned during the show.

David S. Ware has a web site at http://www.neolabtv.com/davidsware/index.htm

Also, check out the AUM Fidelity site. It’s Steven Joerg’s label that has released a number of excellent Ware CDs.

Continue reading →

Sam Rivers At Vision Festival Xi

June 15, 2006

I saw Sam Rivers play last night (Wed, 14th) at Vision Festival XI (http://www.visionfestival.org/)

I saw him once before play with this trio at the ICA in Boston a number of years ago. This time the first set was his big-band which I’ve only heard on CDs. In person you really can feel the power of this band.

 Check out Sam’s site (http://www.rivbea.com/) for his latest CD Aurora which they were selling at the show. It’s the latest from the big-band and is excellent.

Continue reading →

Interesting Diversion

June 14, 2006

I discoved PlaceOpedia (http://www.placeopedia.com). It connects Wikipedia articles with their locations using Google maps (http://maps.google.com).

Here’s my diversion.

  1. Set the map to be at it most Zoomed in. click the + (Zoom In) control box in the left side of the map.
  2. Click on button “Random place”.
  3. Try to guess where the place is as you Zoom out one level at a time (the – box).

 Some entries will give themselves away with their name but others will challenge your sense of geography.

Continue reading →