Modified/not modified handling for element classes
Reliable tracking of the "modified" (aka "dirty") status of data objects, especially those in hierarchies, is important. I've now implemented the system I outlined in the earlier post, with modified status appropriately migrating up or down the tree so that it can easily be determined at any point. I've also started writing more careful testing code.
One issue I haven't yet faced, but I'm beginning to think about, is how to manage changes such as the linkType property of a link element. I can't simply allow that to be changed, because a link may be part of a linkGrp, and in that case the linkGrp would manage the linkType; and in turn, the change of linkType actually represents a move of the link from one linkGrp to another, which itself ought to be managed at the level of the linkGrpSet. I could actually remove the linkType attribute from links altogether, on the basis that in this project, I'm never going to allow that to be used in the context of the link itself or the linkGrp, but only at the level of the linkGrpSet, but that would be rather inflexible; and it does, somehow, seem to be a property of the link when considered from the user's point of view (as it is in the current IMT, where it's shown as a category).
All this needs careful thought before I commit to a strategy.