Patent ID: 8347316

Claim:
A computer-implemented method for linking the behavior of two command objects to provide synchronous operation thereof, comprising the steps of: creating a first command object that is either in a done state or an undone state and is associated with a first context, wherein the first context is associated with a last command object executed within the first context; creating a second command object that is either in the done state or the undone state and is associated with a second context, wherein the second context is associated with a last command object executed within the second context; establishing attributes associated with the first command object and the second command object that link the second command object to the first command object; and synchronizing execution of the first and second command objects, wherein synchronizing the execution of the first command object and the second command objects comprises: determining the last command object associated with the first context of the first command object; responsive to the state of the last command object associated with the first context, executing the last command object associated with the first context to achieve an opposite state of the first command object; accessing, from the last command object associated with the first context, the second command object linked thereto; and responsive to the state of the second command object, executing the second command object to achieve an opposite state of the second command object; wherein the steps are performed by a computer.