~/talk

Algebraic Data Type in Java 17

TalkinFrenchat Devoxx France 2022 · 2022-04-20..04-22· [java]
slides:none on file

Shows how Java 17 features—sealed interfaces, records, and pattern matching (preview)—can be used to model algebraic data types as closed sum types, replacing enums and fragile class hierarchies. Demonstrates by building a robot command DSL (commands: move with steps, turn with direction, qt with counts) and then adds state-indexed commands so the compiler rejects invalid sequences (e.g., destroy before expose, turn while moving); includes code and notes the preview/feature limitations.

AI-written summary · about

  1. 0:00Start
  2. 1:12Goal
  3. 2:33Problem Presentation
  4. 10:35Creating an Abstract Class
  5. 16:26Algebraic Data Types
  6. 19:52Sealed Interfaces
  7. 22:25Flexibility
  8. 29:13Conclusion
~/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.