I have a document, represented as a node tree in Jackrabbit.
When saving a document, I want to first check if certain properties have changed. Whats the best/quickest way of doing this? I want the quickest, but not at the expense of being ugly!
Background…
In brief, I have a copy of this node and I want to know when the master has been updated so I can update the copy. Originally, I just tracked the version number which worked fine. Now there’s a requirement to only update the copy when certain properties have changed. My idea is, when setting each property, first check the existing value against the new one to see if its changed. I will have to do this for all affected properties. if any of the nodes properties, or childrens properties, have been changed I will increment a number to show it has been updated.
Any better ideas out there?
Well, I ended up doing it as per my idea. And the performance seems fine.
Didn’t take long to modify my existing code as I already had a utility class for getting/setting. I just modified the setter’s to return true if a property had changed.