A short note on Property Delegation in Kotlin

Delegation is a design pattern that allows an object to delegate tasks to a helper instance. Kotlin provides the language level support for the delegation pattern by introducing a keyword by. The syntax is: val/var <property name>: <Type> by <expression>  var name: String by DelegateClass() The expression after the keyword by , satisfies the convention for […]

The post A short note on Property Delegation in Kotlin appeared first on Blog.

Source: Mallow Tech