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