Get change commands without modifying collection <p>Probably a very poorly named title, but anyway...</p> <p>I am using the command pattern on a hierarchical data set. So basically I need a method that returns an object that <em>describes</em> the changes that will be made without actually changing the data. So for example:</p> <p>Object 1 -> Object 2 -> Object 3</p> <p>If I move object 1, it will cause a change in Object 2, which will cause a change in Object 3 because they depend on each other. So...I need a method to recursively go through the hierarchical collection and gather up the changes that are required to move Object 1 without actually modifying the collection. Halfway through the recursion it would be nice to be able to use something like Object1.Location, but it may already slated for change so I can't reliably use it.</p> <p>I feel like there are plenty of algorithms and such that need to do this type of "in place" modification. As a non-CS major I didn't learn much of this type of thing, so I don't really even know what search terms to look for to find a "solution". I put solution in quotes because I realize there probably isn't a direct solution for my problem, but I am merely looking for some good guidelines/examples of this being done to get my brain cranking.</p> <p>Can anyone provide some real-world examples of this type of thing being done? Thanks in advance.</p>