Sep 28, 2026
Data-oriented programming in Java 21: modelling domains with records, sealed interfaces and pattern matching 1. Overview For years I modelled domain states in Java with one of two tools: an enum plus a lot of nullable fields, or a class hierarchy plus the Visitor pattern. Both work, but both hide mistakes. The compiler cannot tell me that a CAPTURED payment has no capture date, or that I forgot to handle a new state in one of twenty if chains.
Sep 18, 2026
A Simple Spring Integration Example 1. Overview Spring Integration is a framework that helps you connect systems inside a Spring application. It uses the same ideas as Enterprise Integration Patterns: messages, channels, and endpoints. If you already know Spring Boot, it feels familiar after a few minutes.
In this post I will show a minimal “hello world” example. We will send a name through a gateway, pass it over a channel, and get a greeting back.
Sep 17, 2026
Building a Fluent Java API with Consumer and BiConsumer 1. Overview When I build small internal libraries I try to keep the public API easy to read. Lately I have been using Consumer and BiConsumer a lot to let callers configure objects without writing long anonymous classes. The result looks like a builder, but each step is just a lambda that sets something up.
In this post I will show a made-up example: a small MenuBuilder that lets you add menu items.