Named Interface Delegation
Kotlin Discussions
Named Interface Delegation
Motivation Kotlin’s interface delegation provides a convenient way to forward interface implementations: class MyService( name: String ) : Service by DefaultService(name) However, the delegate instance is not directly accessible from the declaring class’s source code unless an additional property is explicitly declared. This becomes inconvenient when implementing more advanced object composition patterns. For example, I may want to: Access the original delegate instance. Wrap an ex...
0 comments
No comments yet.