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.

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.

Das Memento Pattern

Bei der Entwicklung von Software handelt es sich immer um die Formulierung von Lösungen in Form von Software. Söll die Software eine gute Lösung für ein Problem sein, dann sind Design Pattern eine gute Hilfe. Design Pattern sind Musterlösungen für typische Probleme in der Softwareentwicklung. Wer sie kennt, entwickelt nicht nur Software, die eine etablierte Lösungsstrategie verfolgt, sondern erhöht auch den Wiedererkennungswert für Kollegen und reduziert die Entwicklungszeit.

Für jedes Design Pattern gibt es ein entsprechendes Problem und beim Memento Pattern ist es die Frage, wie der Zustand eines Objekts zwischengespeichert werden kann, ohne seine interne Struktur zu entblößen.

Einfaches Trace-ID Logging in REST Anwendungen

Das Logging von Web-Anwendungen, bzw. allen Server-Anwendungen ist mit seinen eigenen kleinen Tücken versehen. Die üblichen, mehr oder wenig hilfreichen Log Anweisungen, die sich im Source Code tummeln, sorgen für einen stetigen Strom von Log-Ausgaben. Solange sich die Ausgabe auf einen einzelnen Request bezieht, ist häufig noch sehr gut nachvollziehbar, was gerade auf dem Server passiert. Bei sehr vielen Anfragen an den Server leidet aber die Übersicht.