~/talk

Rethinking API Design with Traits

Talkat SpringOne2GX 2014 · 2014-09-08..09-11· [api-design]
links:none on file
slides:none on file

Groovy 2.3 adds a new trait feature that provides stateful and composable behavior bricks usable on JDK 6/7/8; traits compile to an interface plus a helper class and are compatible with static compilation. Traits resolve method conflicts by declaration order or explicit super calls, and use namespaced trait fields so a class and its traits don’t clash — it avoids diamond problem. Runtime coercion of objects to traits generates a proxy (so runtime coercion creates proxy and incurs allocation cost).

AI-written summary · about

  1. 0:00Intro
  2. 0:27About me
  3. 1:45About Groovy
  4. 12:15Delegation
  5. 14:30Groovy example
  6. 16:45Extension methods
  7. 20:22Default methods
  8. 23:21Stateless methods
  9. 25:35Groovy
  10. 26:35Flying
  11. 28:47Basic Traits
  12. 30:46State
  13. 32:34Multiple Trades
  14. 33:47Trades as Capabilities
  15. 34:46Traits as Inheritance
  16. 37:33External vs Implements
  17. 39:20Abstract Methods
  18. 41:54Why Traits
  19. 47:49Traits Matter
  20. 55:35Runtime coercion
~/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.