You may want to look at overriding the gethashcode and equals methods of your domain objects and storing the original hashcodes in a hashtable by object key. Then create a process that takes an object, find its key in the hashtable and compares hash values.
- If hash same, no change. (do not send to repository or database)
- if hash different, object has changes. (update)
- If key not found, object is new. (insert)
- Not sure how to determine if object needs to be deleted other than process delete on request and not using hashcode tracking for them.
I have not tried this and a hashtable may not be the best way to track object keys/hash values. It would save mem by tracking only hash codes and keys only. I am not 100% sure, but I think some orm's may use this method in their data context/tracking objects.