Detect a variable change

Hi guys,

Let’s say I have a class, and I created a new object of this class in my document class.
Inside this class, there is a public variable.

How would i be able to detect a change in that public variable?

Thanks :smiley: