When to traverse an object graph
<ul>, and many UserView objects would render their own
<li> elements; but an individual UserView would never reach into the parent collection to, let's say, check whether another user was currently selected. That's probably a code smell, pointing to the need for a
selectedUser property on the collection.
So, what's going on here? Even if you disagree with me in this particular case, what are some of the general 'rules' that guide this kind of reaching across object relationships? Do the responsibilities for objects in parent-child relationships change so drastically when those objects belong to a GUI, rather than a business domain? What rules apply to all objects in parent-child relationships? Are there rules more specific than looking out for feature envy in our objects?
I welcome your thoughts.