- (id)changeType;
Each change is identified by a type. Similar to an event (name), a changeType is used
to determine the changes that affect some data.
For example: most commonly, a change type
will directly correspond to a property name. Imagine a Person with an "address" property.
An address change might then be done by a change that has "PersonAddressChange" as its
identifier. The Person implementation will then use this identifier to find the changes
on the address property that have been done within the current transaction.
- (void)commit;
This method is called during the commit phase of a transaction.
It's task is, to apply the change (such as a "change name to 'Bob'") to the
target object. When this method is called directly (i.e., outside the
transaction framework) the effect is undefined. Most probably the change will
just be applied without being controlled anyhow.
if a change could not be applied, this method is required to throw an NSException
(of any type). Then, the transaction will be rolled back.
- (void)rollback;
When this method is called, the change (if it has already been applied)
must be undone (such as, setting the variable value to the old name)
you should really make sure that this method does never throw an exception and undoes changes!
If an exception is thrown, the other changes will be rolled back, but the application
may remain in an undefined state (because this change may not have been undone)
if it is important wheather the commit has been called before or not the atomic change
implementation has to care for this itself. rollback will be called independently from
commit;
- (id)target;
Returns the target object where this change will be applied on when commit is called
Result: The target object(Last Updated 8/31/2006)