Data Oriented Programming in Java: Chapter 8 Progress (2025-05-12)

Published: 2025-05-12

Early Access here: Data Oriented Programming in Java

Current Stats:

  • Words: -
  • Listings: -
  • Figures Used: -
  • Figures Made: -

I'm still waiting for feedback on Chapter 7. Work begins on chapter 8.

Chapter 8 is secretly about building interpreters. This is a missing skill in the general population of developers. When confronted with complex business rules, people reach for heavy-weight engines, frameworks, symbolic algebras, or, the most prevalent of all for the type of problem we'll cover in the book, regexes. I've sat through many design reviews where regexes were the proposed "solution" (now you have two problems). What they really needed was a custom interpreter.

Algebraic Data Types and Java's new record patterns make building interpreters in Java small. A few lines of code. No complex types. No hierarchies. No Visitor Pattern. Plain data and functions.

I say that all of this will be done "secretly" in the chapter, because "interpreter" is a very loaded word. Same with terms like "Domain Specific Language" (which you could also argue we're making). These imply "heavy" things. Grammars. Lexers. Parsers. No, thank you. The "interpreters" we'll cover in the book are lean, powerful, and built from plain Java.