Better Tools for Immutable Data
summary
Survey of concrete Java features that make immutable data easier: records and record patterns supply final components, automatic equals/hashCode and deconstruction; JEP 468 (derived record creation) provides a with-block to produce modified copies; value classes/records remove identity enabling VM encodings that embed data and shrink heap indirections; early-field initialization, the lazy constants API, marshalling-based deserialization, initialization diagnostics, and final arrays reduce unsafe reflective mutation and enable JVM optimizations. Future items remain in flux.
AI-written summary · about
chapters (16)
- 0:00Immutable data in Java
- 1:03Object-oriented programming and immutability
- 3:50Defining immutable data
- 7:19Challenges with immutability
- 10:06Best practices in classic Java
- 14:22Java 17/21 features
- 17:09Java 17/21/25 features
- 26:57Derived record creation
- 31:36Value records and classes
- 36:49Extending record benefits
- 38:32Deconstructors
- 40:38Serialization and immutable data
- 43:30Protecting final fields
- 45:35Lazy constants and arrays
- 48:25Modern Java best practices
- 49:06Q&A
related talks
13mThe Record: Migrate to Immutability
01h 00mImmutable Data with Java: Using Immutable Data Structures
42mBetter Modeling Through Records
46mJava Records for the Intrigued
54mData Oriented Programming with the JDK 19
53mData oriented Programming in Java
52mJava Language Futures
42mPure Functions and Immutable Objects
