reference - Cross referencing objects management -


often have unit , node object. units required know node @ , nodes have know units holding. means each have reference each other. problem have can see getting messy since moving unit new node means having update reference nodes too. there easier way model/organize relationship? specific example in lua question applies language.

it may easiest manage 1 side using caching protocol. if information changes, invalidate cache. then, when side needs information again, obtains it.

in example, perhaps node has authoritative list of units, while each unit caches node on. perhaps these units stopped , started, , unit can node attached when starts?