[PEAK] Commands, Actions, Undo/Redo, and transactions

Niki Spahiev niki at vintech.bg
Thu Jul 29 12:12:33 EDT 2004


Phillip J. Eby wrote:

>> a -> b
>> b -> c
>>
>> becomes single action a -> c
> 
> 
> I guess we could add a 'merge(otherItem)' method to IHistoryItem, which 
> took a second item (b->c in your example) and merged it into the 
> existing item with that key.  The 'add()' operation on IHistory would 
> look to see if it had an item with the same key and then would call 
> 'merge(new)' on the old one.  State-based mementos would just define 
> 'merge()' as 'pass', so I guess it wouldn't complicate things too much.

My apps successfully use merge(new).

Niki Spahiev




More information about the PEAK mailing list