Hi again Regunath,
You are correct that you will want to produce snapshots periodically, so that newly started clients don't have to bootstrap their state engines from the beginning of time (the first and only snapshot ever produced). Based on the comment "it appears incorrect for me to compare a Snapshot with a Delta even though all objects are added to the state engine in each cycle", I think there might be some confusion about deltas and snapshots: When you compare two data states, you are not comparing "deltas" vs "snapshots". Deltas and snapshots are transitions to data states, they are not the states themselves. For example, let's say we create a data state on our server and call it version "1", then produce a snapshot. If we load that snapshot on a client, the client state engine will be at version "1". Now, if we create a new data state on our server and apply it on top of the state engine which we previously loaded with version "1", we can call this version "2". We can produce both a snapshot and a delta from this state. A new client can load the snapshot and get to version "2". However, our client with version "1" already loaded can load the delta and also get to version "2". There will be no difference in the data between the new client which loaded a full snapshot of version "2", and the preexisting client which applied a delta on top of version "1" to get to version "2". When we do a diff, we compare data states, not data transitions. It doesn't matter how we arrived at the data states.
Your proposed approach will work, but there are much more efficient ways to get this.
Here is one way to achieve your goal more efficiently. If you recall, we added a class TypeDeserializationStateListener soon after release, partially based on your earlier comments. For each of the types you are interested in tracking add a TypeDeserializationStateListener. Each time you apply a delta (or another snapshot) and any field changes in a specific object, you will receive one call to removedObject and one call to addedObject. Each time you receive a removedObject call, store it off into some temporary "removed objects" collection. Each time you receive an "addedObject" call, store it off into some temporary "added objects" collection. At the end of this process, you can match up the removed and added objects by their keys, then check each of those for their differences.
You may want to do the matching yourself between your from / to collections, then detect the differences yourself as well. However, if you want to do this in a semantically independent way, you may save yourself some maintenance down the line if your data model changes. You should be able to quickly get the differences as a TypeDiff object by creating a TypeDiffOperation and a DiffSerializationFramework. Call performDiff on your TypeDiffOperation with your removed objects collection as the "fromState" argument, and your added objects collection as the "toState" argument.
Give this a try and please let us know if this works for you.
Thanks again,
Drew.