# Killing Reflection at Build Time: Avro, Codename One and Java Codegen (#103)

> Episode of [Foojay.io | Friends of OpenJDK and Java Programming](https://podistic.com/podcast/foojayio-friends-of-openjdk-and-java-programming.md) · Published October 17, 2026 · Duration 44:30 · Episode 103, season 6

- **Listen on Podistic:** https://podistic.com/episode/killing-reflection-at-build-time-avro-codename-one-and-java-codegen-103
- **Audio:** https://anchor.fm/s/10b9c3cfc/podcast/play/127521605/https%3A%2F%2Fd3ctxlq1ktw2nl.cloudfront.net%2Fstaging%2F2026-9-15%2F434233552-44100-2-296f73c8ca9fd.mp3 (audio/mpeg)

## About this episode

Runtime reflection is a quiet tax on the JVM. It is flexible, it is everywhere, and it is easy to stop noticing it until you go looking for where your CPU is actually going. Two teams did exactly that, in completely different corners of the ecosystem, and arrived at the same answer: move the work to build time.

In this episode, **Dmitry Moskalyuk** explains the model layer behind his Foojay article on reflection-free serialization, where JSON, XML, YAML and TOML all end up as Avro. **Shai Almog** explains the build-time codegen pipeline of Codename One, which aims for no reflection, no service loader and no Class.forName. We compare the two and ask whether generated code is really something to avoid.

Topics include:

*   Where Jackson's reflection cost really lives, and what Blackbird does about it
*   Jackson versus kotlinx.serialization, and why a missing feature sent the team back to Jackson
*   Why a UI framework bans reflection, and how that differs from the backend
*   Is generated code bad? Lombok, Manifold and jOOQ
*   What Records and Project Leyden change for reflection
*   Build time cost versus runtime cost, and a single source of truth for your data model
*   Should you still use reflection in a new project?

  

**Guests:**  
Dmitry Moskalyuk, Senior Backend Engineer  
[Dmitry on LinkedIn](https://www.linkedin.com/in/dmitry-moskalyuk/)  
Shai Almog, Author, DevRel and open source developer working on Codename One  
[Shai on LinkedIn](https://www.linkedin.com/in/shai-almog-81a42/)

**Links:**

[Dmitry's article on Foojay](https://foojay.io/today/reflection-free-serialization-on-the-jvm-four-formats-in-avro-out)  
[Shai's article on Foojay](https://foojay.io/today/openapi-orm-svg-and-lottie/)  
[Jackson Blackbird](https://github.com/stevenschlansker/jackson-blackbird)  
[Apache Avro](https://avro.apache.org/)  
[Project Leyden](https://openjdk.org/projects/leyden/)  
[Full show notes with every link](https://foojay.io/today/foojay-podcast-103/)

**Timestamps:**  
00:00 Introduction of topic and guests  
01:50 About the new Foojay, contributing with GitHub pull requests  
03:17 What is Apache Avro  
04:26 What is Codename One  
06:31 What is Blackbird in Jackson and compared to kotlinx mechanisms for different content parsers  
10:01 Why Codename One focuses on "no reflection, no service loader, no Class.forName"  
14:23 Is automatically generated code bad (Lombok, Manifold, JOOQ)?  
17:47 Java evolutions that bring improvements into the system (Records, Project Leyden)  
21:31 Is reflection changing through Java versions?  
24:29 Build time cost versus runtime, Project Leyden  
28:41 Use of reflection in UI versus backend  
32:16 Benefit of your data model in a (Java) object, having one source of truth, good debugging  
35:35 Should you worry about serialization in a small project  
37:38 Serialization and security  
38:57 Should I still use reflection/serialization in a new project?  
43:22 Conclusion
