https://kotlinlang.org logo
#announcements
Title
# announcements
e

eric239

05/19/2017, 4:43 PM
Is there a “kotlin way” to handle delegation to a class (as opposed to an interface). E.g. I have a class
Base
which doesn’t implement anything, and I want to create class
Derived
which extends
Base
and delegates to an instance of
Base
. I know I can use regular java dynamic proxies; wondering if there’s a “kotlin” way.
d

dalexander

05/19/2017, 4:55 PM
eric239: I guess the Kotlin way would be to extract the interface from
Base
that you want
Derived
to use, then delegate to the interface. There’s no way delegate to a class built in to the language.
e

eric239

05/19/2017, 5:06 PM
okay, makes sense
3 Views