chriskiehl/Data-Oriented-Programming-In-Java-Book — dự án mã nguồn mở — đang có 59 sao GitHub. Source code for Data Oriented Programming in Java
Tóm tắt dựng từ metadata GitHub của chính dự án — chưa có bài review TopGit. Trang sẽ tự động cập nhật khi bài review đầy đủ được xuất bản.
VÌ SAO CHƯA CÓ REVIEW
TopGit viết bài đầy đủ cho repo có nhiều sao nhất và được yêu cầu nhiều nhất. Trang này là snapshot trong thời gian chờ — xem README gốc ở tab READ ME.
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].
chriskiehl/Data-Oriented-Programming-In-Java-Book có bao nhiêu sao?
chriskiehl/Data-Oriented-Programming-In-Java-Book có 59 sao GitHub — tải lại trang để xem số mới nhất, hoặc xem trực tiếp github.com/chriskiehl/Data-Oriented-Programming-In-Java-Book. TopGit phản chiếu số sao của GitHub nhưng không cam kết đến từng phút.
chriskiehl/Data-Oriented-Programming-In-Java-Book có phải mã nguồn mở không?
Có — chriskiehl/Data-Oriented-Programming-In-Java-Book phát hành theo license MIT, nghĩa là mã nguồn mở để đọc, fork và (tùy license) tái sử dụng. Mã: github.com/chriskiehl/Data-Oriented-Programming-In-Java-Book.
chriskiehl/Data-Oriented-Programming-In-Java-Book có tag gì không?
Bản đồng bộ chưa ghi nhận topic GitHub nào cho chriskiehl/Data-Oriented-Programming-In-Java-Book. GitHub topics hiển thị ở thanh bên phải trang repo — đó là nơi đáng kiểm tra nhất.
chriskiehl/Data-Oriented-Programming-In-Java-Book có website riêng không?
TopGit chưa ghi nhận URL trang chủ cho chriskiehl/Data-Oriented-Programming-In-Java-Book. Phần README ở tab phía trên thường có link demo, hoặc xem mô tả GitHub của repo.
chriskiehl/Data-Oriented-Programming-In-Java-Book còn đang phát triển không?
Commit gần nhất trên chriskiehl/Data-Oriented-Programming-In-Java-Book là 1 tháng trước (theo timestamp GitHub). Repo có 5 fork — một chỉ báo về mức độ quan tâm của cộng đồng.
Đọc thêm về chriskiehl/Data-Oriented-Programming-In-Java-Book ở đâu?
Trang TopGit này là một snapshot — tab "Readme" hiển thị nguyên văn README của repo (đã bỏ link, giữ ảnh). Repo GitHub ở github.com/chriskiehl/Data-Oriented-Programming-In-Java-Book là nguồn chính thức.
Đọc đầy đủ README ở tab phía trên.
Chưa chắc Data-Oriented-Programming-In-Java-Book có hợp với bạn?
Để ChatGPT, Claude hoặc Perplexity tìm hiểu giúp — bấm bên dưới và xem AI nói gì về Data-Oriented-Programming-In-Java-Book.