Tech/LxEngine/Features & Tasks/Transaction Support
This is a future feature.
- lock / unlock objects.
- discard changes
- clone / fork objects (and retain history)
- strong / weak inter-object referencing
- persistent unique ids on objects
May require some notion of "robust" objects for the general case and "slim" objects for runtime efficiency. Or an internal conversion that objects don't pay for that extra functionality until it is actually used. Internal memory management could use handles and pools of objects to automatically convert the underlying object.
The basic concept is to view the Document as something like a version control repository. Each Element is effectively a 'file' in this analogy. It would track add/removes/branches of Elements. Modifications to Elements would take the force of add/remove/modify of attributes or the Element value. These values are all JSON-like quantities that in term can be broken down in add/remove/modify of the JSON object tree.
The transaction model would be more like Perforce in requiring explicit opening of objects (all objects read-only by default). The transaction model would also allow for nested transactions as well, which is not something a traditional VCS supports.