Attending a JBoss Hibernate course a while ago, I noticed how much session management (amongst lots of other things) has matured between Hibernate 2 and 3.
Filed under Hibernate, Java | 1 Comment »

Last week all of us at Inspiring visited the JavaPolis conference in Antwerp. JavaPolis is a five-day event organized by the Belgian JUG consisting of two university session days followed by three normal conference days. The university sessions were three-hour in-depth technical presentations. The fifty-minute conference sessions were less intensive but sometimes also less boring
We attended just two days, the last university day on Tuesday and the first conference day on Wednesday.
On Tuesday a couple of us visited the ‘Spring Business Tier’ session by Juergen Hoeller and Rob Harrop, who presented some new features of Spring 2.0.
The first part of their presentation was quite interesting, which covered the new XML namespace features. Instead of using the default DTD, in Spring 2.0 you can use XML schema’s in your configuration. By using schema’s it’s possible to add more ‘typing’ to your configuration, which reduces the chance of making mistakes. Besides that, I think it makes your configuration much more readable. Spring itself will have 4 default schema’s you can use, JNDI, AOP, UTIL and TX (Transactions) .
At the top of your configuration you can now declare your schema’s:
xmlns:jndi="http://www.springframework.org/schema/jndi"
xmlns:tx="http://www.springframework.org/schema/tx"/>
And if you want to lookup a datasource through JNDI for example you can use a much more powerful and intuitive definition:
The whole idea behind this schema usage was to make the use of AOP through Spring much easier and the first step was to simplify the configuration.
This explanation lead to their second subject, improved integration with AspectJ. Spring 2.0 now uses the AspectJ syntax to specify pointcuts, even if you don't use AspectJ as the AOP implementation. This makes working with AOP a lot more powerful. You can also use the same Aspects in Spring and in AspectJ without making any changes to your aspects. By using standard annotations (again…) your aspects will be compatible with both Spring and the AspectJ compiler. I personally have some doubts about annotations, if you don’t use them well they can really pollute your code.
After a short break the subject moved to the CommonJ WorkManager. The CommonJ WorkManager is very specific for Websphere and Weblogic users. I think I will keep using Quartz when it comes to scheduling instead of this WorkManager, it seemed a little complicated for simple problems.
The last part of their presentation covered JMS and Message-Driven POJO’s. This sounded very interesting because in one of our current projects where we have to deal with JMS in the near future. But it sounded more interesting than it really was, Juergen Hoeller kept talking about the differences between the two JMS specifications without really explaining the Message-Driven POJO concept.
In the afternoon there was a session about the Java In Action session by Dion Almear and Ben Galbraith. This session was very good. It was technical and very practical also. They started with a very familiar example of Ajax: form completion. Every step of setting up a form supported by Ajax was covered and, best of all, everything was coded live on stage.
After the introduction, they shifted to the most famous Ajax business case, Google Maps. The first surprise was that GoogleMaps isn’t really Ajax at all. It is just a very sophisticated usage of Javascript and HTML <div> elements. Then they proceeded to reimplement the whole Google Maps functionality, including drag-and-drop and zooming, live on stage in a few simple steps. This was all very impressive.
At the end they showed some frameworks that can make using Ajax a lot easier for developers. I personally prefer DWR. This framework lets you make use of Ajax in very (Java) natural way without having to make lots of changes in your classic web tier.
The next day, the first conference day, some of us went to the keynote by Jeff Jackson vice-president of the Sun Developer program. His talk was a little bit boring, but T-shirt launcher was nice. Every time when there was Duke on a slide a T-shirt signed by James Gosling was launched into the audience.
Always fun to see a bunch of geeks getting excited by a free T-shirt.
Later on I visited a session about JMX. In some way JMX always draws my attention. Although I never used in a real project it still stays a promising technique for managing some part of your configuration. I say promising cause I see and hear a lot of people talking about JMX, but just a few people really used it around projects.
For the last session that day I went to a session about ‘Continuous Integration’. The title itself wasn’t really exciting but it’s always fun to see someone tell story and try to convince a large audience about the advantages of using Continuous Integration during your projects. To have a continuous and quick feedback loop is so powerful and really increases the quality of your codebase. As an example that a continuous build server also can be fun, he showed usage of two lava lamps, red and green, which are connected to the build server.
If a build failed, the green lamp was turned off and the red one turned on. Even a manager can now see there’s problem. The fun thing was, before a lava lamp really gets warmed up this will take some minutes. Their sport was to fix the build before the red lamp was really on and if lava lamp is turned off before it’s warmed up, you’ll have some nice figures in the pasta in the lamp. Now they tried to keep this figures as long as possible and the only thing you can arrange this, is not to break the build. I know you must be a really big nerd to like this, but I think it’s a very nice and simple way to show that your project tries improve it’s quality. For the people who like the idea, on the site of pragmatic programmers there’s a list of components and instructions how to build your lava lamp enabled build server.
All the Javapolis presentations will become available in the next couple of months on various Java comnuity sites like TheServerSide and the JavaLobby.
Filed under General | No Comments »
Picture this: a dimly-lit basement-like room filled with PCs, a large projection screen showing the current standings and 30 teams of 2 people each hunched over a computer. Although just as hectic, this is not a multiplayer game of Quake or Doom, but rather the Masters of Java programming contest.
The contest runs for a whole day, with each team competing in 5 tasks (out of 6, each team was assigned one task they would not be competing in). Each task contains one or more Java source files, with one class or method still to be implemented. The client software (an applet) behaves as an IDE (though no handy Javadoc lookup or code completion) and is used to compile the code, run the testcases and submit the results.
Our team (named Inspiring 42 after a counting mishap
) participated for the first time. Although we did have experience in other programming contests, the MoJ format was new to us: the realtime program/compile/test cycle, the short timeline for each task (30 minutes) and the large visible clock (and accompanying sound effects, like the crash of a gong at the start of the round and an annoying bleep-bleep sound when another team submits a solution).
The organizers published a preview of the cases on the MoJ site days before the event. That a lot of the contestants had looked at these and guessed what the tasks might be showed during the first assignment (validating Sudoku puzzles). Solutions for the Sudoku problem were entered very quickly. We had also done our homework and managed to be the first competing team to succesfully submit a solution.
For the second task we had to implement a simple load-balancing algorithm. Again, we finished first. Everything was looking good and the main price (a SUN Opteron workstation) was almost ours!
The third task had to do with regular expressions and this was really tough for us. At the end of the alotted 30 minutes we still had not found the correct regular expressions to solve this problem. Funny enough, neither had the winning team -- they solved the problem by creating an anonymous inner class that parsed the input using a StringTokenizer. Hardly what the organizers had in mind, but it worked and earned them 20 points. I just wish we had thought of it!
Obviously, this debacle caused us to drop to the number two spot. Worse, the team in the #3 position did not compete in the first task, so they could pass us if they performed well in the task we would not compete in. This was the fifth task: performing MD5 hash calculations to find suspect employees. We did well (finishing first again) but that did not score us any points since we weren't competing. So now we were in the #3 position.
The last official assignment, AaiRobot, was a funny one. The idea was to guide a robot through a maze to it's home location. There was very little information to go on, though, only a bump sensor, light sensor (to sense the color of the tile the robot was on) and a test to see whether or not this was the destination square. There was no indication of how far the robot was from the final square.
Also, the last test case required the robot to walk along a corridor and, halfway through, turn left without any indication. After attempting to come up with a generic algorithm, we realized a different approach was needed and, using trial and error, we determined the exact location at which to turn left (using the total distance travelled by the robot) that worked for the test case and submitted the result.
Even though we gave it our best shot we never recovered from the regexp task. The robot-task was a weird one and I'm not sure I like it. In the end, we did not submit a correct algorithm but a program that manages to complete the testcases. A small change such as moving the destination square in the final test case left by one square will break our "solution".
All in all, the contest was a great experience and a lot of fun. We'll be sure to participate again next year. And you better believe we will have studied up on regular expressions by then!
Team Inspiring 42 a.k.a. Erik Rozendaal / Martin van Vliet
Filed under General, Java | 1 Comment »