~/talk

Enums on steroids - let's look at sealed classes!

Talkat JDD 2024 · 2024-10-22..10-23· [java, compilers-and-language-design]
slides:none on file

A loan-evaluator example implements three distinct outcomes—approve, refuse, suspend—using Java records, pattern matching, and sealed interfaces so the compiler enforces exhaustiveness and eliminates casts; switch with arrow labels and guarded patterns handles nuanced approval subcases (full vs reduced amount); record deconstruction pulls fields into case labels; unnamed patterns let unused values be skipped. Code migrates off Lombok and compiles on modern JDKs (Java 17–23), but preview features like string templates remain unstable and can change.

AI-written summary · about

  1. 0:00Introduction and welcome
  2. 2:29About the speaker
  3. 3:11Business case: loan engine
  4. 8:09Modeling the response system
  5. 14:28Problems with legacy code
  6. 16:13Modernizing with Java 13
  7. 17:16Records for immutable classes
  8. 20:49Pattern matching in switch
  9. 26:34Guarded pattern matching
  10. 29:52Sealed classes and interfaces
  11. 35:49Java 21 features
  12. 37:53Java 23 unnamed patterns
  13. 40:26Future of Java features
  14. 41:28Why learn new Java features
~/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.