Improve your Java Applications with Records and Pattern Matching
summary
Shows concrete refactors on JDK 17: turning Map<String,Integer> entries into State and Population records, adding a small collector and Comparable so grouping and summing works and tests run unchanged. Demonstrates pattern matching for instanceof and switch, uses sealed types to restore exhaustiveness, and previews record pattern matching in JDK 19 plus future array/map deconstruction. Claims performance cost is negligible (hundreds of nanoseconds vs milliseconds for I/O). Emphasizes applied code examples and live refactoring that compile and run.
AI-written summary · about
chapters (8)
- 0:00Start
- 21:59Amber: Record Pattern Matching (prev 19)
- 23:08Switch and Record Pattern Matching
- 23:34Array Pattern Matching
- 24:05Nesting Patterns + Type Inference
- 24:55Amber: the Future of Pattern Matching
- 25:42Deconstruction Using Factory Methods
- 29:57Patterns at a Glance
related talks
01h 08mClean Application Development with Records, Sealed Classes and Pattern Matching
54mData Focused programming with Pattern Matching in Java
43mRolling with New Java Enhancements: Practical Design Patterns
37mRecord Patterns - Going Beyond Records - A Deep Dive
50mPattern Matching in Java Deep Dive
56mThe Art of Java Language Pattern Matching
38mPattern Matching in Java: Better Code, Better APIs
46mThe Art of Java Type Patterns
