-
Class size
Imagine that you need to maintain two applications. Both are about 20.000 lines of code. Now imagine that one has about 10 classes, and the other has 200 classes. Which one would you rather work with? I’ve had discussions about whether you should favor many classes over fewer. When you only take into account the…
-
Javadoc
In our current project there is a guideline that all of the public API must have Javadoc. I disagree with this guideline. Our project does not have a public API, since we’re the only team that works on this project and no other team is allowed to use the codebase. Public classes and methods are…
-
Internet of Things
On 19 April 2017 about 1300 tech enthusiasts gathered in Utrecht for the IoT tech day. During this day I noticed two themes: on the one hand there were project demos, on the other hand there were talks about why you should use certain products and services to connect your projects. This showed me the…
-
Technical Debt
Technical debt is acquired when you take shortcuts while developing your software. It helps you get the changes in place faster, but it results in code that is harder to understand. Ward Cunningham coined this term while he was working in a financial institution to explain why they were refactoring. His boss at the time…
-
Test driven development
TDD is the ultimate agile practice. You can’t get faster feedback cycles than with TDD: often a cycle lasts well under a minute. Because of this, you always know that you’re moving to the target. However, I’ve met very few people who know about TDD, and even fewer who actually practice it. I was at…
-
Maven, Hibernate, PrimeFaces and Jetty
In this post, we will make a (very) simple CRUD application using Maven, Hibernate, PrimeFaces and Jetty. It won’t be the best application out there, but enough to get started. Run ‘mvn jetty:run’ to start the application. Click here to download the actual project. In this case, we’ll be making a simple addressbook, with each…
-
Split condition
Intuitively it makes sense to group several statements in an if/else clause. In that case you only need to execute the check once. However, this is not always the cleanest solution, and it makes methods longer than they should be. For example, take the following piece of code. So, what’s wrong with this? It does…
-
Working with multiple screens in Java
When you want to set the location of a Java Window, you just call setLocation(int x, int y). But what if your screen isn’t big enough? Or when you want to display the window on a second screen? The desktop is represented by a virtual device, with physical screens providing a viewport onto that device.…
-
Pomodoro 0.2 released
It has been a while since the first version of this pomodoro tracker has been released. Development has continued, and there have been a few changes: Backported to Java 1.7. Added popup dialog when Pomodori are done, to ask whether to register it as a complete one: Added popup dialog when breaks are done, to…
-
WAS Deploy Script
When you’re developing for IBM Websphere, you could update your application using the webinterface. But that is a bit slow, and you risk trashing your Websphere installation. You can also use a script. Below is a Windows batch file to do just that.