Introduction to class delegation in Kotlin

Click for: original source

Technically, what you’re going to see in this chapter is more precisely known in the broader programming community as “forwarding” rather than “delegation”. However, in the Kotlin world, it’s always referred to as delegation, so we’ll continue to use that term here. By typealias.com.

The tutorial then dives into following topics:

  • Delegation in restaurants and code
  • Manual delegation
  • Easy delegation, the Kotlin way
  • Multiple delegates
  • Overriding a delegated call
  • Managing conflicts
  • Delegation for general and specific types

In Kotlin, sometimes an object is fully capable of fulfilling a request (such as a function call) on its own, and in other cases, it might need to hand off the request to another object. Nice tutorial!

[Read More]

Tags java programming app-development kotlin