Delegation (위임)
클래스 위임
Delegation 패턴은 상속의 좋은 대안임이 증명되었다. Kotlin은 네이티브에 보일러플레이트 코드(boilerplate code) 가 필요없다.  Derived 클래스는 인터페이스 Base로부터 상속 받아 모든 public 메소드를 지정된 객체에 위임 가능
interface Base {
    fun print()
}
class BaseImpl(val x: Int) : Base {
    override fun print() { print(x) }
}
class Derived(b: Base) : Base by b
fun main(args: Array<String>) {
    val b = BaseImpl(10)
    Derived(b).print() // prints 10
}
Derived의 상위 타입 목록에 있는 by 절은 Derived의 객체 내부에 b가 저장되고 컴파일러가 b로 전달되는 Base의 모든 메소드를 생성함을 나타낸다.