Data Oriented Programming in Java: Chapter 5 Progress (2024-12-22)
Published: 2024-12-22
Current Stats:
- Words: 12,960
- Listings: 50
- Figures Used: 20
- Figures Made: 66
- Repo: 1000s of new lines of code, documentation, and annotations
Manuscript for this chapter is "done." I've finished all my tinkering. My preferences would be to sit on it for the next several weeks so I can revise with fresh eyes, but MEAP instills a lot of pressure to get stuff out the door. So, out the door it goes. It'll do its sitting in public. Shortcomings proudly on display.
The repository side of things is also done. As usual, it has it's own narrative that walks through the major ideas in the chapter. Often, the listings end up with more detail than the ones in the book because they're not constrained by physical page widths. So, I'm free to go crazy with arrows and annotations. And I do love me an arrow pointing at things.
// ┌────────────────────────────────────────────────────────────────────┐
// │ Capturing lifecycle state as a Type Variable │
// └────────────────────────────────────────────────────────────────────┘
//
// ┌─ We can "parameterize" LateFee by its Lifecycle information
// │
// │ ┌─ The generic Type Variable, State, is bounded by
// ▼ ▼ the type Lifecycle. It won't accept anything else!
record LateFeeV2<State extends Lifecycle>(
State state, // ◄──────────────┐ This type variable is referenced on the
USD total, // │ model, which unifies the compile-time and runtime
LocalDate invoiceDate,// │ representations!
LocalDate dueDate,
List<PastDue> includedInFee
){}
On to the next.
Plans for next week: None. Decompress. Enjoy the holidays. Maybe play a video game or something.