Superpowers of Kotlin Delegation
summary
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
chapters (15)
- 0:00Start
- 4:06Kinds of Delegation
- 4:46What Is Delegation
- 6:23Polymorphic Behavior
- 7:02Avoid Inheritance
- 9:27Barbara Liskov Substitution Principle
- 11:51Decorator Pattern
- 18:14Property Delegation
- 27:28Lazy Delegate
- 28:14Observable
- 28:49Android Examples
- 34:54What Are Puzzlers
- 37:23Normal Properties
- 51:19Is It Possible To Use Generics in Property Delegate
- 52:44Delegate Decorator








