Have gone through the official docs and some tutorials online but still quite unsure where and when to use Interface Delegation.
When do you use Interface Delegation in your projects? 🤔
Examples and instances would be greatly appreciated. 🙏🏾
n
Nikky
11/16/2020, 10:02 AM
i use it when i want to compose classes of multiple objects ie common and specifics
Copy code
data class ComposedComponent(
val common: Common,
val specific: SpecificComponent
): ICommon by common, ISpecific by specific
it saves typing and making copypaste errors
sadly it does not flatten it magically inside serialization