Long Time, No See, Stream Collector Utility

The stream-collector-utilities library has provided several useful collectors for Java 17 up to this point. Since it was starting to show its age, it was time for an overhaul. The library now ships four ready-to-use Gatherers that complement its existing Collector classes. This post walks through each of them.

FreshMarker APT

Sometimes you develop things while on vacation because you’ve always wanted to try them out but don’t really see any practical use for them. That’s the case with FreshMarker APT. APT stands for Annotation Processed Templating and simply means applying the FreshMarker template syntax to Java code in a way similar to String Templates.

FreshMarker – compile it! (3)

In the second article on the FreshMarker Compiler, we looked at the implementation of a pretty printer for Template instances. This implementation serves as the basis for the FreshMarker Compiler, which generates Java code from a Template instance. Before we tackle the Compiler, we need to look at a few more hurdles and details.

FreshMarker – compile it! (2)

In the first article on static FreshMarker templates, some basic thoughts were put on paper. This article is intended to set a first milestone on the way to supporting much faster templates than before. As a nice side effect of this initial work, a pretty printer for FreshMarker templates will be created.

Passage of Time Events

It’s not that often that a design pattern really blows my mind anymore, but recently I discovered the Passage of Time Pattern by Mathias Verraes. This pattern describes how to deal with time-dependent processes in event-based systems. What makes this pattern stand out is its elegance and simplicity.

Trunk Based Development

prefer trunk based development over gitflow

Every now and then, a way of working creeps in that is assumed not to correspond to established procedures. How nice it is when it is seen by many as a best practice and even has a name. In this case, it is a special version control practice, you guessed it, Trunk Base Development.

REST endpoints with filters

Java Bibliotheken

This article is a slightly updated English version of the article “REST Endpunkte mit Filtern”.

In addition to sorting and pagination, filtering is a fairly common action on REST endpoints. In contrast to the first two, however, there is no adequate solution for filtering in the Spring Boot framework. With little effort, however, this can be elegantly implemented with the Spring Boot tools.

Sneaky Throws – Exceptions aus dem Hinterhalt

Die Einführung der Generics in Java 8 hat zur einigen eigentümlichen Konsequenzen geführt. Die meisten dieser Konsequenzen fußen auf dem Konzept der Type Erasure. Die Generics sind nur Bestandteil der Java Sprache und werden demzufolge nur vom Java Compiler beachtet. Der compilierte Code kennt, salopp gesprochen, keine generische Typen sondern operiert auf dem vermuteten Basistypen der Generics.