Isn't there more simple way to achieve something l...
# announcements
j
Isn't there more simple way to achieve something like this, that is to "compose a type from other types" without inheritance? https://proandroiddev.com/kotlin-composition-and-delegation-d1a387f8c158
Ended up experimenting like this:
Copy code
data class Foo(private val bar: Bar): BarFields by bar
downside is you still need to define interface BarFields which adds some duplication when you have lot of fields
d
That is the most common way of doing it as far as I know