Lets consider following example, I have "Document" object which contains collection of "Person" objects and each "Person" object has collection of "Address" objects. When one of the "Address" object changes I need to call server-side method to calculate optimal path between all addresses of a person(whose "Address" was changed) and update user interface. I need to know that one of addresses was changed and person whose address was changed. The only solution I have so far is to implement some sort of event bubbling. When "Address" object changes it notifies parent("Person" object) about the change, "Person" notifies "Document". Now we can add listener to "Document" class and make required actions. Downside of this approach - I have to manage "parent" links for all the objects in the hierarchy. Can somebody comment on this solution? is it good? Or maybe I am doing something wrong here?
Thanks.