A Java Geek weekly 86

A dive into the Builder pattern

I wrote this in 2013, and I believe it still applies today.

  1. In real-life software, the builder pattern is not so easy to implement
  2. Less is more: create an easy-to-use DSL is (very) hard
  3. Scala makes it easier for complex builder implementation’s designers than Java
Bad Type Patterns - The Duplicate duck

A "duplicate duck" is a type that implements a subset of traits of a popular type with the same results.

If you aren’t into Rust, feel free to skip to the end. IMHO, bad ducks happen much more often when you’re a junior developer on a stack and don’t know the type system well enough.

Don’t Unwrap Options: There Are Better Ways

I’d favor ok_or() or ok_or_else() myself. I need to learn (and use!) about the let else approach; it seems really nice.

Don’t Guess My Language

TL;DR: don’t use IP geolocation for language detection as it’s easily broken with countries with multiple languages and VPN. Instead, use the Accept-Language HTTP header.

The Guide to Hashing I Wish I Had When I Started

A good starting guide to hashing, to put in the hands of junior developers.

Why Property Testing Finds Bugs Unit Testing Does Not

I’ve read a couple of posts on property-based testing, and I always wondered about the problem of finding the correct properties. Either the property is dead simple and you don’t need property-based testing, or it’s hard to find, and well–it’s hard to find. I’m happy somebody with experience highlights the issue.

Devstral

Introducing the best Open-Source model for coding agents.

Open-Source, European, and over-performs proprietary models. What’s not to like?

Fluent APIs Are More Than Just Chaining

Method chaining alone does not make an API fluent.

See my article on the Builder pattern above. You need to implement a state machine, which an quickly become a mess, depending on the complexity of your API.

Spring Data Ahead of Time Repositories

With Spring Data 4.0 (or the 2025.1 release train if you prefer calver) we are taking your repositories to AOT. We are shifting all the Repository preparations that are done at application startup to build time.

OpenBeken

OpenBK7231T/OpenBeken is a Tasmota/ESPHome alternative for modern Tuya-based modules, offering MQTT and Home Assistant compatibility. Although this repository is named "OpenBK7231T_App", it has evolved into a multiplatform application, supporting builds for multiple chipsets from various vendors, including ESWIN, Transa Semi, Lightning Semi, Espressif, Beken, WinnerMicro, Xradiotech/Allwinner, Realtek, and Bouffalo Lab.

Documenting Your Prompts a Best Practice for Success

Result

OK/NOK

Name/Version

[name and version of your prompt]

Goal

[One sentence explanation of the goal of this attempt]

Model

[name and version of the used model]

Temperature

[value between 0 - 1]

Top-K

[number]

Prompt

[Write all the full prompt]

Output

[Write out the output or multiple outputs]

Nicolas Fränkel

Nicolas Fränkel

Nicolas Fränkel is a technologist focusing on cloud-native technologies, DevOps, CI/CD pipelines, and system observability. His focus revolves around creating technical content, delivering talks, and engaging with developer communities to promote the adoption of modern software practices. With a strong background in software, he has worked extensively with the JVM, applying his expertise across various industries. In addition to his technical work, he is the author of several books and regularly shares insights through his blog and open-source contributions.

Read More
A Java Geek weekly 86
Share this