Design question: Suppose we have parent and child object. Sometimes child object says "Parent, you've got to update your state." So, is there any critical difference between
- Passing parent object reference into child contructor
and
- Passing parent object callBack function into child constructor
of course, Except the case when child has to be revoked any chance to affect parent object other than using this callBack function.
Aucun commentaire:
Enregistrer un commentaire