chriskiehl/Data-Oriented-Programming-In-Java-Book is one of the open-source repositories TopGit tracks, currently at 65 stars, written primarily in Java. Source code for Data Oriented Programming in Java
Snapshot summary built from the project's own GitHub metadata — there's no written TopGit review yet. The page will update automatically when a full review is published.
WHY NO REVIEW YET
TopGit writes full reviews for the most-starred, most-requested repositories. This page is a snapshot until then — see the READ ME tab for the original README in full.
Source code for the book Data Oriented Programming in Java (by me! Chris Kiehl!)
Get the book here!
ISBN: 9781633436930
[!Note]
This book is in Early Access while I continue to work on it. This repository will be updated as new chapters are released.
This book is a distillation of everything I’ve learned about what effective development looks like in Java (so far!). It’s what’s left over after years of experimenting, getting things wrong (often catastrophically), and
slowly having anything resembling “devotion to a single paradigm” beat out of me by the great humbling filter that is reality.
Data-orientation doesn't replace object orientation. The two work together and enhance each other. DoP is born from a very simple idea, and one that people have been repeatedly rediscovering since the dawn of computing: “representation is the essence of programming”. Programs that are organized around the data they manage tend to be simpler, smaller, and significantly easier understand. When we do a really good task of capturing the data in our domain, the rest of the system tends to fall into place in a way which can feel like it’s writing itself.
Getting Started with this project
To download a copy of this repository, click on the Download ZIP button or execute the following command in your terminal:
(If you downloaded the code bundle from the Manning website, please consider visiting the official code repository on GitHub at https://github.com/chriskiehl/Data-Oriented-Programming-In-Java-Book for the latest updates.)
The project is built with Gradle.
gradle build
Running the code
The tests/ package houses all the runnable code. You can run all the tests in a class with this command:
gradle test --tests 'path.to.test.Class'
e.g.
gradle test --tests 'dop.chapter02.Listings'
How to use this repository
Each chapter in the book has an associated package in the src/test/ directory. Most of the examples aren't necessarily things that we'll run. They're primarily for study. We'll look at them and go "Hmm. Interesting." DoP is a book that's about design decisions and how they affect our code. We're striving to make incorrect states impossible to express or compile. Thus, a lot of the examples are exploring how code changes (or disappears entirely) when we get our modeling right.
Listings in the Book vs Code
Each listing in the book will have a corresponding example in the code. The Javadoc will describe which listing the code applies to.
/**
* ───────────────────────────────────────────────────────
* Listing 1.1
* ───────────────────────────────────────────────────────
*
* Here's an example of how we might traditionally model
* data "as data" using a Java object.
* ───────────────────────────────────────────────────────
*/
Sometimes, separate listings in the book will be combined into one example in a single class.
/**
* ───────────────────────────────────────────────────────
* Listings 1.5 through 1.9
* ───────────────────────────────────────────────────────
* Representation affects our ability to understand the code
* as a whole. [...]
* ───────────────────────────────────────────────────────
*/
[!Note]
The class names in the code will often differ from the class names used in the book. Java doesn't let us redefine classes over and over again (which we do in the book as we refactor), so we 'cheat' by appending a qualifying suffix. For instance, ScheduledTask in listing A might become ScheduledTaskV2 or ScheduledTaskWithBetterOOP. The listing numbers in the Javadoc will always tie to the Listing numbers in the book.
Character Encodings
Make sure your IDE / Text editor is configured for UTF-8 character encoding (Windows tends to default to other encodings). Many of the in-code diagrams leverage the utf-8 charset.
Example utf-8 diagram:
// An informational black hole!
//
// ┌──────── It returns nothing!
// ▼
// void reschedule( ) { // ◄─────────────────────────────────┐
// ... ▲ │ Compare how very different
// } └────── It takes nothing! │ these two methods are in
// │ terms of what they convey
RetryDecision reschedule(FailedTask failedTask) { // ◄───┘ to us as readers
// ...
}
Classes inside of methods
[!Note]
Some listings will have classes defined in the body of the listing. These are only there because Java doesn't allow us to define records with forward references directly in a method's body, whereas doing it inside a class is fine. Thus, the kinda wonky occasional pattern of class(method(class (record, record, record, etc.)))
class Chapter05 {
void listing5_13() {
class __ { ◄─────────────────────────────────┐ This nested class is here becuase Java doesn't support
│ certain forward references / type hierarchies if you try
// ... │ to define them directly in the body of the method.
// rest of example code │ Wrapping all the definitions in their own class allows
// ... │ things to (mostly) behave as expected.
}
}
}
Table of Contents
Chapter
Code Listings
Chapter 01 - Data Oriented Programming
Listings.java
Chapter 02 - Data, Identity, and Values
Listings.java
Chapter 03 - Data and Meaning
Listings.java
Chapter 04 - Representation is the Essence of Programming
Listings.java
Chapter 05 - Modeling Domain Behaviors
Listings.java
Chapter 06 - Implementing the domain model
Listings.java
Chapter 07 - Guiding the design with properties
Listings.java
Chapter 08 - Business Rules as Data
Listings.java
Chapter 09 - Refactoring Towards Data
Listings.java
Chapter 10 - Data Oriented Architecture
Listings.java
Chapter 11 - Data Oriented Testing
Listings.java
Chapter 12 - Writing Integration Tests
Listings.java
Questions and Feedback
I'd love to hear any and all feedback. You can leave comments in the Manning forum. I'm also very responsive to emails. If you have a questions, feel free to write me at [email protected].
Does chriskiehl/Data-Oriented-Programming-In-Java-Book have a project website?
No homepage URL was recorded for chriskiehl/Data-Oriented-Programming-In-Java-Book in TopGit's last sync. The README tab above frequently contains screenshots and demo links, or check the repository description on GitHub.
Does chriskiehl/Data-Oriented-Programming-In-Java-Book have any tags?
TopGit's last sync did not record any GitHub topics for chriskiehl/Data-Oriented-Programming-In-Java-Book. GitHub topics appear in the right sidebar of a repository page; that's the authoritative place to check.
How active is development on chriskiehl/Data-Oriented-Programming-In-Java-Book?
The most recent commit recorded on chriskiehl/Data-Oriented-Programming-In-Java-Book was 4 months ago, based on the GitHub push timestamp. The repository has 4 forks — one of the better signals of community interest.
How many stars does chriskiehl/Data-Oriented-Programming-In-Java-Book have?
chriskiehl/Data-Oriented-Programming-In-Java-Book has 65 GitHub stars — refresh the page for the live number, or check github.com/chriskiehl/Data-Oriented-Programming-In-Java-Book. TopGit mirrors GitHub's count but does not claim minute-by-minute accuracy.
Is chriskiehl/Data-Oriented-Programming-In-Java-Book open source?
Yes — chriskiehl/Data-Oriented-Programming-In-Java-Book ships under the MIT license, which makes its source code freely readable (and, depending on license terms, forkable and reusable). Source: github.com/chriskiehl/Data-Oriented-Programming-In-Java-Book.
Where do I read more about chriskiehl/Data-Oriented-Programming-In-Java-Book?
This TopGit page is a snapshot — the READ ME tab shows the project's own README content (links stripped, images preserved). The GitHub repository at github.com/chriskiehl/Data-Oriented-Programming-In-Java-Book is the definitive source.
Read full README in the tab above.
Want a second opinion on Data-Oriented-Programming-In-Java-Book?
Ask an AI that can read this page — one click and you get its take on Data-Oriented-Programming-In-Java-Book.