We break down how to use a delegated property in Kotlin via
by and the ready-made delegate
Delegates.observable: when the handler is called (after assignment), what parameters it receives (
old/
new and property metadata), how not to break encapsulation with
private
set, and where this approach is especially convenient—logging, a “dirty” flag, a change counter. At the end—common mistakes: recursion in the handler, trying to validate “after the write”, and noisy logging.