~/talk

The Three Amigos: Intermixing Pattern Matching, Records, and Sealed Classes

Talkat Great International Developer Summit 2025 · 2025-04-22..04-25· [java]
slides:none on file

Java now gives records give ctor/getters/toString/equals/hashCode so simple data holders are immutable and final; sealed permits clause enforces closed hierarchies so only listed subclasses compile and children must be final/sealed/non-sealed; pattern matching upgrades switch into an expression with guarded cases, dominance checks, and deconstruction of record components; combining all three lets the compiler prove exhaustiveness (no default needed) or emit a DefaultMatchException in stray runtime cases; the demo builds buy/sell records + sealed trade and the examples compile and run as shown.

AI-written summary · about

  1. 0:00Introduction to three amigos
  2. 1:04Records as data carriers
  3. 15:13Records immutability and usage
  4. 16:14Sealed classes and interfaces
  5. 26:12Sealed hierarchy modifiers
  6. 35:49Pattern matching basics
  7. 46:30Guards and dominance in pattern matching
  8. 48:47Compiler trade-offs in pattern matching
  9. 49:07Interplay of features in practice
  10. 56:55Records with sealed classes
  11. 1:00:52Data-oriented programming summary
~/search
type to search 6,249 conferences, 138,987 speakers and 185,172 talks
~/help
cmdctrl k
search every conference, speaker and series
/
focus the filter search
h
home
c
conferences
s
speakers
e
series
t
light / dark — the status bar button does the same
?
this help
esc
close this, then clear every filter — or just the search, while you are typing in it

Ignored while you are typing. Pages without a filter rail have no search to focus.