> Markdown version of [/videos/1634-data-oriented-programming-version-1-1](https://www.wearedevelopers.com/videos/1634-data-oriented-programming-version-1-1). Every page supports `.md` or `Accept: text/markdown`. Links point to the HTML versions so they work for humans too. Agent guide: [/agents.md](https://www.wearedevelopers.com/agents.md). --- # Data-Oriented Programming - Version 1.1 Is object-oriented design cluttering your data-heavy subsystems? Master Java's data-oriented paradigm using pattern matching and sealed interfaces to build safer, compiler-enforced domain models. - **Speakers:** [Nicolai Parlog](https://www.wearedevelopers.com/@nicolai-parlog) - **Event:** World Congress 2025 - **Published:** August 20, 2025 - **Duration:** 28:24 - **URL:** https://www.wearedevelopers.com/videos/1634-data-oriented-programming-version-1-1 ## Summary Data-Oriented Programming in Java provides a modernized paradigm where programs are viewed as a continuous series of transformations on transparent data. Originating from functional concepts and popularized in Java by Brian Goetz, this approach serves as an excellent alternative to standard object-oriented designs for data-heavy subsystems where combining disparate operations—like payments, graphing, and state management—clutters a single class. The approach relies on modeling data immutably and transparently, defining the exact domain constraints, making illegal states unrepresentable, and strictly separating logic from data state. Applying this paradigm relies heavily on language features like Java records and sealed interfaces. While records provide transparent data carriers, developers are encouraged to enforce deep immutability during construction to prevent external tampering. When ingesting messy real-world inputs, modeling a two-stage validation utilizing an unverified intermediate type ensures that the final application state is unambiguously correct. Furthermore, sealed interfaces define an explicitly closed inheritance hierarchy, transforming ambiguous implicit data structures into self-documenting APIs that guarantee type safety. The true power of data-oriented programming emerges when operations are extracted from the data models and managed at the external boundary using pattern matching and switch expressions. Instead of relying on brittle chains of type checks, exhaustiveness in switch expressions against sealed types forces the compiler to raise an alert whenever a new data variant is added, acting as a native, painless implementation of the visitor pattern. Integrating new features like JDK unnamed patterns allows developers to cleanly separate the structural shape of the data they want from the subsequent processing logic by visually filtering out irrelevant properties. Ultimately, while this paradigm will not replace object-oriented programming entirely, it offers a drastically safer, compiler-enforced pattern for domain modeling inside data-centric application boundaries. **Keywords:** data-oriented programming, java records immutability, sealed interfaces inheritance, pattern matching extraction, exhaustive switch expressions, separating operations from state, illegal state prevention, unverified data ingestion, visitor pattern alternatives, unnamed patterns syntax, domain-driven data modeling, polymorphic data operations, implicit application state, deep immutability enforcement ## Chapters 1. **Introduction to data-oriented programming techniques in Java** (00:04) — Data-oriented programming views applications as functional pipelines that apply transformations over data instead of mutating hidden states. 1. **Defining a GitHub web crawler domain model codebase** (02:28) — A GitHub web scraper serves as a practical domain modeling example for applying explicit application constraints. 1. **Exploring the behavioral challenges of simple object-oriented modeling** (05:04) — Traditional mutable getter interfaces continually fail to prevent contradictory or theoretically impossible application state combinations. 1. **Modeling immutable data structures intricately using Java records** (07:32) — Java records combined with defensive collection copying guarantee underlying structural representations remain transparently and deeply immutable. 1. **Defining precise domain boundaries leveraging Java sealed types** (09:52) — Combining distinct Java interfaces and lightweight records into a closed inheritance hierarchy strictly defines valid combinatorial states. 1. **Preventing illegal application states through aggressive constructor validation** (12:49) — Isolating raw messy input shapes from sanitized destination objects rigidly enforces model correctness at the processing boundary. 1. **Separating structural domain architectures from core business operations** (15:37) — Migrating complex domain logic completely outside core data structures mitigates bloated code components and tangled feature dependencies. 1. **Executing conditional logic gracefully via sealed pattern matching** (16:48) — Java switch expressions safely drive decoupled polymorphic behaviors by interrogating the precise underlying shapes of transparent domain constructs. 1. **Deconstructing syntax trees explicitly using unnamed Java patterns** (19:40) — Innovative record deconstruction techniques and unnamed variable concepts implemented in newer Java versions dramatically bolster operational code readability. 1. **Enforcing exhaustive state coverage implementing intentional compiler errors** (22:07) — Maintaining sealed structural hierarchies deliberately provokes highly visible compiler errors whenever developers integrate untreated implementations into switch statements. 1. **Balancing pure data-oriented principles alongside functional object-oriented systems** (26:07) — Organizations must pragmatically deploy focused record structures or broader structural architectures conditionally depending upon localized system component goals. ## Related Moments - [Implementing data-oriented programming architectures in Java](https://www.wearedevelopers.com/videos/667-modern-java-this-is-not-your-father-s-java-anymore) (from "Modern Java: This is not your father's Java anymore") - [Applying data-oriented programming for concise java syntax](https://www.wearedevelopers.com/videos/947-algebraic-data-types-pattern-matching-elegant-and-readable-java-code) (from "Algebraic Data Types + Pattern Matching = Elegant and readable Java code") - [Exploring pattern matching features and constructs in java](https://www.wearedevelopers.com/videos/947-algebraic-data-types-pattern-matching-elegant-and-readable-java-code) (from "Algebraic Data Types + Pattern Matching = Elegant and readable Java code") - [Shifting to reactive programming paradigms in Java code](https://www.wearedevelopers.com/videos/89-development-of-reactive-applications-with-quarkus) (from "Development of reactive applications with Quarkus") - [Comparing imperative, declarative, and reactive programming paradigms](https://www.wearedevelopers.com/videos/751-is-reactive-the-new-black-imperative-vs-reactive-programming-with-quarkus) (from "Is reactive the new black? Imperative vs. reactive programming with Quarkus") - [Using Java records to create immutable data carriers](https://www.wearedevelopers.com/videos/342-the-cool-thing-about-cool-things-in-java-16-17-lts) (from "The Cool Thing about Cool Things in Java 16 & 17 LTS") ## Related Articles - [Modern Java Records](https://www.wearedevelopers.com/magazine/41-modern-java-records) - [Using Java 17 latest features in real world projects](https://www.wearedevelopers.com/magazine/121-using-java-17-latest-features-in-real-world-projects) - [Modern Java Switch Expressions](https://www.wearedevelopers.com/magazine/40-modern-java-switch-expressions) - [Java Basics](https://www.wearedevelopers.com/magazine/122-java-basics) ## Related Jobs - [Principal Software Engineer, Database Infrastructure](https://www.wearedevelopers.com/jobs/ext/1465908-principal-software-engineer-database-infrastructure) at **GitHub** - [Senior Software Engineer](https://www.wearedevelopers.com/jobs/ext/15942-senior-software-engineer) at **GitHub** - [Data Engineer](https://www.wearedevelopers.com/jobs/ext/1276933-data-engineer) at **PROSOZ Herten GmbH** - [Principal Software Engineer, Identity](https://www.wearedevelopers.com/jobs/ext/1469181-principal-software-engineer-identity) at **GitHub** - [Senior Data Engineer](https://www.wearedevelopers.com/jobs/ext/1589390-senior-data-engineer) at **Douglas GmbH** - [Senior Backend Engineer (Java)](https://www.wearedevelopers.com/jobs/ext/19369-senior-backend-engineer-java) at **Bonial International GmbH**