Constructor
new GraphObject()
Members
abstract identifier
The getter return a property which serves as the identity in the store. The value should be suitable to act as both an object and a map key.
abstract identifier
The setter must record the value as the instance identity in the store.
state
Return the current instance state, ["clean", "deleted", "dirty", "new"], to reflect the correspondence between the instance state and that in the store.
Methods
asPatch()
compute the put/patch/delete patch given the object state implement as properties of the base function to permit extension
createProxy()
The final step of GraphObject base constructor invokes this to create the proxy which wraps the target instance and manages its property access. It excludes those which begin with '_' and limits control to GraphObject#managedProperties, if specified. Object#set is augmented to record modifcations and Object#get can be augmented perform property-specific retrieval. Set modifies instance state as a side-effect. As a special case, given get('_self'), it returns the target instance.
initializeInstance()
Provide a method to perform general initialization out-of-line.
initializeState()
Provide a method to initialize the code properies from the constructor out-of-line and for direct object creation
managedProperties()
Return an array of the names of managed properties, to be managed by the proxy.
oncreate(deltas)
Accept a delta-array with the state of the new instance.
Parameters:
Name | Type | Description |
---|---|---|
deltas |
[ [String, Any], ...] |
ondelete(deltas)
Notify that the instance has been deleted from the store.
Parameters:
Name | Type | Description |
---|---|---|
deltas |
[ [String, Any], ...] should include just the identifier property. |
onupdate(deltas)
Accept a delta-array with changes to the state of the new instance.
Parameters:
Name | Type | Description |
---|---|---|
deltas |
[ [String, Any], ...] |
persistentProperties()
Return an array of the names of persistent properties, to be managed by the proxy.
persistentValues()
Return an array of the values of persistent properties.
rollback()
Use a delta array to restore the state of the target instance. nb. also undefined values, could restrict to null
rollforward()
Use a delta array to assert the new state of the target instance. nb. also undefined values, could restrict to null
transactionalProperties()
Return an array of the names of properties subject to roll-back when a transaction is aborted.