~/talk

Sealed Classes, Unsealed Complexity

Talkat droidcon Toronto 2019 · on Wednesday, 2019-11-13· [kotlin, frontend-architecture]
slides:none on file

Demonstrates that Kotlin sealed classes replace fragile enums and ad‑hoc error handling by modeling concrete outcomes: a login API is refactored into LoginSuccess/LoginFailure wrappers, enums fail because they cannot carry state, and sealed classes carry tokens, messages or exceptions and enable exhaustive when checks at compile time. A second example replaces duplicated search/refresh UI code with a sealed SearchViewState so states become mutually exclusive view states, reducing bugs, duplication and feedback cycles.

AI-written summary · about

  1. 0:00Start
  2. 14:11Disadvantages of Enums
  3. 14:35Scaled classes
  4. 18:06Advantages of Sealed classes
  5. 32:24Overview
~/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.