A transaction is a unit of change to an object. The granularity of a transaction may span from the result of a single operation to that of a set of multiple operations. In an ideal model, transactions are applied immediately, and there is support for "rolling back," or undoing, transactions. Because there are times when this is not practical, specific interface conventions have been established for committing transactions. If there are pending transactions in a window when it is closed, always prompt the user to ask whether to apply or discard the transactions.
Transactions can be committed at different levels, and a commitment made at one level may not imply a permanent change. For example, the user may change font properties of a selection of text, but these text changes may require saving the document file before the changes are permanent.
Use the following commands for committing transactions at the file level.
Command |
Function |
Save |
Saves all interim edits, or checkpoints, to disk and begins a new editing session. |
Save As |
Saves the file (with all interim edits) to a new filename and begins a new editing session. |
Close |
Prompts the user to save any uncommitted edits. If confirmed, the interim edits are saved and the window is removed. |
Note
Use the Save command in contexts where committing file transactions applies to transactions for an entire file, such as a document, and are committed at one time. It may not necessarily apply for transactions committed on an individual basis, such as record-oriented processing.
On a level with finer granularity, you can use the following commands for common handling transactions within a file.
Command |
Function |
Repeat |
Duplicates the last/latest user transaction. |
Undo |
Reverses the last, or specified, transaction. |
Redo |
Restores the most recent, or specified, "undone" transaction. |
OK |
Commits any pending transactions and removes the window. |
Apply |
Commits any pending transactions, but does not remove the window. |
Cancel |
Discards any pending transactions and removes the window. |
Following are the recommended commands for handling process transactions.
Command |
Function |
Pause |
Suspends a process. |
Resume |
Resumes a suspended process. |
Stop |
Halts a process. |
Note
Although you can use the Cancel command to halt a process, Cancel implies that the state will be restored to what it was before the process was initiated.