lundi 14 janvier 2019

How to notice parent object that child objects have been changed?

If i need to make the object knoW about its state change, i make all properties private and add setters and getters for them.

What about if object's property is another object. I can get it by link with get method, change it, and parent object won't know about it.

I suppose it is a regular problem and it should have a traditional solution. What pattern should I read about?

Aucun commentaire:

Enregistrer un commentaire