Axelix Uses Java ScopedValues and Sealed Interfaces to Solve Real Production Problems
Mikhail Polivakha, technical lead of the open-source Axelix project, has detailed two practical uses of modern Java features in a real production codebase. The project uses ScopedValue — a newer alternative to ThreadLocal — to pass a security context token from an HTTP filter down to the transport layer without threading it through every method signature. Axelix also employs sealed interfaces not for pattern matching, but to enforce domain design constraints at the platform level rather than relying on informal developer agreements. Both examples demonstrate that newer Java features, introduced under the language's six-month release cycle, can address genuine architectural problems beyond interview questions or toy projects. The article aims to counter the common pattern where teams read about new JEPs but continue writing the same code they wrote years ago.
This is an AI-generated summary. ShortSingh links to the original source for the complete article.


Discussion (0)
Log in to join the discussion and vote.
Log in