6 07, 2017

One dot per line saves time

By |July 6th, 2017|Architecture & Design, Java|0 Comments

Today I want to introduce you to a simple rule that I apply when developing software. This rule often saves me a lot of time and it is simple to apply. I usually write code in Java and so the rule is made for Java programming in the first place, but it might also be adapted […]

19 05, 2016

Make method pre-conditions explicit by design

By |May 19th, 2016|Architecture & Design, Java|0 Comments

A method usually makes assumptions about the arguments that are passed into it by a method invocation. The conditions that the arguments must fullfil are named the method’s pre-conditions. Thus a good method implementation checks if the arguments are in an expected state so that the method can execute.

Often developers use basic data types as method parameters like String, […]

19 03, 2016

Progress Object Pattern

By |March 19th, 2016|Architecture & Design|0 Comments

When a user executes a long running background task an application usually wants to report progress about the task to the user. Application developers often do this by passing a ProgressListener to the background task’s  method and the method uses the ProgressListener to report it’s progress. But you can also design it in another way and I would like to […]

2 01, 2016

A plug-in architecture implemented with java

By |January 2nd, 2016|Architecture & Design|0 Comments

Instead of building monolithic applications developers prefer modular and extendible applications. Either they want to use the flexible architecture by themselfs or provide a plug-in api for other developers. In both situations one must define a modul’s purpose and it’s boundary. This module boundary is also called the service provides interface (SPI) or also a plug-in api. Java’s jar […]

3 12, 2015

Enums as type discriminator anti-pattern

By |December 3rd, 2015|Architecture & Design, Unit Tests|3 Comments

In Java 1.5 enums were introduced to ease handling of constant values. Enums can improve code quality, because they are types that the compiler can check. But they can also be misused and lower the code quality. In this blog I want to discuss the misuse of enums as type discriminators and show you why this […]

1 05, 2015

Singleton implementation pitfalls

By |May 1st, 2015|Architecture & Design|0 Comments

In this blog I want to show implementation pitfalls of the singleton pattern and show you why enums are the better singletons.

The singleton pattern is widely known and discussed a lot of times. Developers often prefer to implement a singleton using a final static field. But this approach has some pitfalls or rather malicious code can […]

25 04, 2015

Instanceof vs. polimorphism

By |April 25th, 2015|Architecture & Design|0 Comments

An instanceof check is often an indication for misplaced source code. Some developer say that instanceof checks are ugly code, but there are reasons against instancof checks beyond a subjective feeling. In this blog I want to compare instanceof checks with polymorphism and discuss the downsides. This blog is intended to be used as a basis for desing decisions and discussions […]

19 04, 2015

How to partially revert a commit in git?

By |April 19th, 2015|Git|0 Comments

Reverting commits in git is quite simple if you want to revert a whole commit. But how to partially revert a commit? In this blog I want to show you a safe approach to partially revert a commit.
10 04, 2015

Bugs love logging to hide

By |April 10th, 2015|Architecture & Design, Integration Tests, Testing, Unit Tests|0 Comments

A lot of projects run integration and unit tests, but often miss a little something – logging. When you use logging you often check if the log level is enabled or not before you log. But this means that you introduce a control flow statement that enables or disables some code. So if you […]

28 12, 2014

GitDirStat – a git maintenance gui

By |December 28th, 2014|Git|0 Comments

Some time ago I wrote the blog “Remove directories and files permanently from git”. Removing files from a git history is not an unusual task and I thought that it would be nice if there is an easier and faster way to do it. I thought that there should be a gui that help you to find […]