Share E-Book

Data-Oriented Programming in Java [MEAP V11, Early Access 9 chapters from 11] (Chris Kiehl)(Z-Library)

Author

Rating No ratings yet

Log in to rate

Java
Language English

Simplify your Java code with data-oriented programming! Data is the heart of your code. Data-oriented programming is a programming technique that enables you to precisely model domains and write large enterprise-scale applications that are oriented around the data they manage. Take a data-oriented approach to your Java applications, and you’ll enjoy simpler state management, improved readability, and no more state-related bugs! The book teaches you how to use immutable strongly typed data effectively and take full advantage of the modern data-oriented features built into the Java language. In Data-Oriented Programming in Java and you’ll learn how to: • Model your domain accurately using records, sealed classes, and pattern matching • Use objects to manage side-effects • Harness the power of plain data • Make illegal states impossible to represent • Let the data types guide your implementation • Never write another Null check or experience another NPE! The book shows you how to transform how you think about Java code by adopting a data-first mindset. Author Chris Kiehl has honed his data-oriented Java skills in the trenches of daily development at Amazon. This guide reveals those hard-earned techniques and approaches that will elevate your skills as a Java coder. about the book In Data-Oriented Programming in Java you’ll learn what you might have thought was impossible: how to use Java’s type system to make code self-documenting, implicit behaviors explicit, and incorrect states impossible to even compile. This practical book teaches you how to use records, sealed classes, and pattern matching to represent the data in your domain, explore data’s inherent meaning and semantics, and represent them in their code. Each new concept is fully illustrated with a hands-on example that demonstrates how DOP helps you write scalable, testable, and maintainable code.

Format EPUB
Size 11.8 MB
165
Views

AI Guide

AI Reading Assistant

Whole-book reading guide from stratified index samples; jump to passages in the text

Full assistant
AI guide
【One-Line Pitch】 A practical guide to making Java code simpler and safer by putting data—not objects or behaviors—at the center of your design. Best for working Java developers who know classes, interfaces, and generics, and want to reduce state-related bugs in large codebases. 【Book Arc】 - **Opening (~0%–10%)**: Introduces data-oriented programming and argues that data should be modeled "as data"—ordinary values independent of classes and behaviors—because precise representation is the foundation of understandable programs. - **Early (~10%–35%)**: Shows how vague representations (like using `String` for a UUID) allow infinite illegal states, and how replacing them with precise types changes what code communicates to readers. - **Middle (~35%–50%)**: Uses a scheduled-task example to demonstrate how implicit state meaning forces readers to reverse-engineer intent, causing semantic drift and bugs; argues for making meaning explicit in the data. - **Late (~50%–85%)**: Moves into domain behaviors, implementing domain models, using properties to guide design, treating business rules as data, and refactoring existing code toward data-oriented representations. - **Ending (~85%–100%)**: Covers data-oriented architecture and testing data-oriented programs, though the excerpts only partially cover these final chapters. 【Key Takeaways】 - **Data-oriented programming is about precision, not replacing objects** (Opening): Objects still manage side effects and behaviors, but data representation becomes the primary design focus; well-represented data makes supporting objects emerge naturally. - **Imprecise representations create infinite illegal states** (Early): A `String` ID can hold anything, forcing defensive checks everywhere; using `UUID` instead eliminates entire categories of wrong values at compile time. - **Good representation ripples outward and simplifies the whole codebase** (Early): Precise types reduce the code you must write, remove illegal states, and make programs smaller and easier to reason about. - **Implicit state meaning is a major source of bugs** (Middle): When fields like `attempts` and `scheduledAt` carry unstated semantics, every reader must reconstruct intent inductively, leading to semantic drift and misinterpretation. - **Code should answer "What is it?" before "What does it do?"** (Middle): Data-oriented design asks you to capture the fundamental meaning of your domain data before worrying about operations on it. - **Making illegal states impossible to represent is a core goal** (Early): The book repeatedly returns to using Java's type system—records, sealed classes, pattern matching—to encode domain semantics directly. - **Data types should guide implementation** (Late): Once the data model is precise, the implementation follows from the types rather than being imposed by object-oriented design conventions. - **Business rules can be treated as data** (Late): The book explores representing rules as data rather than scattering them through imperative code, though the excerpts only sketch this direction. 【Reading Tips】 - **Deep-read the early chapters on representation and illegal states** (~0%–35%): These establish the core mindset and are the most concrete, example-driven parts of the book. - **Skim the scheduled-task example if you already understand semantic drift** (~35%–50%): The point is clear early; the detailed walkthrough is useful mainly for reinforcing why implicit meaning hurts. - **Pay attention to the refactoring and architecture chapters** (~50%–85%): These are where the book moves from principles to practice, though the excerpts cover them less thoroughly. - **Keep a Java project open while reading**: The book is hands-on and assumes you will try records, sealed classes, and pattern matching yourself. - **Don't expect a complete reference**: This is an early-access MEAP with 9 of 11 chapters; treat it as a mindset-shifting guide rather than a finished manual. 【Coverage Limits】 This guide is based on stratified excerpts covering roughly the first half of the book in detail, with later chapters on architecture and testing only partially represented. The excerpts do not cover the full implementation of domain behaviors, business rules as data, or testing strategies in depth.

Passage locations

Excerpt 1
ent meaning and semantics, and represent them in their code. Each new concept is fully illustrated with a hands-on example that demonstrates how DOP helps yo...
View in text
Excerpt 2
ere do we put the objects? When do they come back into play? My sell to you is that if we do a really good job of representing our data, the objects we need...
View in text
Excerpt 3
entally changes what the code communicates to us as readers. We’ve made the code describe itself. There’s no ambiguity. We don’t have to chase down coworkers...
View in text
Excerpt 4
we find into our own evolving inductive model of the world. However, there could be another usage lurking in the code that invalidates all of our assumptions...
View in text

Recommended for You

Loading recommended books...
Failed to load, please try again later

Tip the Site

Scan the WeChat Pay or Alipay code to tip. No login required.

WeChat Pay
Alipay
← Back to List