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

janvladimirmostert

06/16/2017, 10:30 AM
I’ve not used Kotln Delegation before since I don’t fully comprehend what it’s useful for. Is it correct to state that delegation allows you to delegate execution in the same way that a proxy can delegate execution to 1 or more implementations of a class ?
1
s

scott

06/16/2017, 3:34 PM
janvladimirmostert: its useful for many things. check out the lazy, observable, and notnull delegates built in.
also it’s great for composition over inheritance. instead of extending classs and overriding 1 method, you can delgate to it for a few methods, and then do your own logic before delgating. and you get to do that with very little boilerplate (where as in java delegate/wrapping classes is boilerplate heavy)
2 Views