~/talk

Superpowers of Kotlin Delegation

Talkat GeeCON 2019 · 2019-05-15..05-17· [kotlin]
slides:none on file

Shows concrete Kotlin delegation mechanics: interface delegation via "by" and property delegation compiling to getValue/setValue, used to implement lazy, observable and notNull delegates; map-backed delegates through extension getValue; decorator composition of delegates; replacement of Java-style boilerplate like ButterKnife with a simple bindView lazy delegate. Demonstrates real artifacts (preference-holder and Android view binding libraries, activity-starter examples) and explains when delegation preserves encapsulation vs. inheritance pitfalls and how it avoids reflection by using extension functions.

AI-written summary · about

  1. 0:00Start
  2. 4:06Kinds of Delegation
  3. 4:46What Is Delegation
  4. 6:23Polymorphic Behavior
  5. 7:02Avoid Inheritance
  6. 9:27Barbara Liskov Substitution Principle
  7. 11:51Decorator Pattern
  8. 18:14Property Delegation
  9. 27:28Lazy Delegate
  10. 28:14Observable
  11. 28:49Android Examples
  12. 34:54What Are Puzzlers
  13. 37:23Normal Properties
  14. 51:19Is It Possible To Use Generics in Property Delegate
  15. 52:44Delegate Decorator
~/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.