Posts by Jacob van Lingen

Battling Java's verbosity

Posted on by  
Jacob van Lingen

Outside the Java community, Java is often regarded as an old and verbose language. Though I love writing Java code, I kind of have to agree with this. New features are implemented slowly and looked upon by the language designers with thorough suspicion. For example, support for multi-line strings has been tried multiple times before Java got official support[1]. If we are talking about verbosity, the Java language needs quite some characters to write a simple function. As I am specializing in functional programming in Java this year, I struggled a lot with this. Read along how I tackled this a little.

Continue reading →

A worthy companion for @RequestBody

Posted on by  
Jacob van Lingen

A while ago I was working on a Spring REST project and had a special wish. I wanted for one endpoint an exception thrown when someone requested it with an object with unknown properties. All the other endpoints with their rest objects should continue to exhibit the same behaviour. Let me share how I did this.

Continue reading →

Let's make a curry

Posted on by  
Jacob van Lingen

One of the first topics you will encounter when studying functional programming will probably be currying. For an imperative programmer not used to mathematical notations, chances are you will find the concept hard to grasp. Then let this be the day you will remember as the day you completely understood currying!

Continue reading →

Oh, those bits and bytes

Posted on by  
Jacob van Lingen

The time is right. Your work is done. The last letter of your Java code has been written. You let the IDE compile the code and a new running version of your app is ready to be released. You’ve done this a thousand times, there’s nothing new on the horizon. The question of what lies beneath, what happens under the hood, has never occurred to you. Until now!

Continue reading →

Expanding the Java Bean Validations

Posted on by  
Jacob van Lingen

Since beginning of time mankind has been looking for a way to separate right from wrong. Where the primeval man judged righteousness by the contributions of the tribe, the current day programmer judges right by the wishes of the customer. For many years the average programmer wrote a bunch of logic to check if the boundaries defined by the client where uphold. As time went on and programming languages involved, metadata could be added to enrich functions, methods, classes and the like.

Of course for Java, these metadata are called annotations. Very soon they were used for a lot of things. Surpressing warnings, managing transactions, building XML/JSON structures and injecting dependencies. And, as you might have guessed by now, validating objects by a set of specific rules. One of the most commonly used frameworks would be the Jakarta Bean Validation framework. But what if I told you the provided annotations of that framework could be very easily expanded.

Continue reading →

Visualizing a nasty virus

Posted on by  
Jacob van Lingen

At the time of writing the coronavirus is raging the earth. Very soon after the outbreak, visualizations of both the virus and the effect of the disease started to appear everywhere. As I partially graduated in the subject of data visualization, I have always been interested in those graphs. Lately, I followed an introduction course to visualize data with D3.js. After I completed this course, I wanted to draw some meaningful graphics with this library. So follow along when I explain a little bit about D3 and then draw a simplified version of the coronavirus molecule.

Continue reading →

Don't be afraid of Docker

Posted on by  
Jacob van Lingen

As a developer, you are familiar with Docker. You push your images to the Hub, use Compose locally and know a thing or two about Kubernetes. Or…​ Well…​ To be honest…​ You don’t. And you are ashamed you don’t know anything about it. You browse the internet and it’s so overwhelming. So you stop looking and continue what you’ve been doing all the time. Deep inside, you still wonder. Can’t anyone not just explain Docker in simple terms? Is it really this hard? Or am I just missing something really obvious?

Continue reading →

How to fix a drop of code coverage with a multi module Maven project

Posted on by  
Jacob van Lingen

Adding code coverage to SonarQube is quite easy for any Maven project nowadays. Just add the jacoco-maven-plugin dependency to your pom.xml, add the prepare-agent execution task, and you are good to go. Even for multiple modules this works out of the box. But time goes on and your application grows as well. You start moving code to other modules, and somehow SonarQube no longer seems to pick up the covered code. What the heck is going on?

Continue reading →

shadow-left