4GL Patterns #3 – Database Update Patterns
There are three ways data on a form can be posted back to the server.- Auto-Commit, where changes are applied to the database once user navigates away from a record.
- Batch, where changes to records are saved as a batch when the user explicitly actions the Save command
- Autosave to pending, where changes are saved to a temporary area, until the user explicitly actions the Save command.
Examples
The autocommit pattern can be seen in applications like MS Access. This patterns avoids catastrophic data loss by saving data for the user, the user does not have to do anything. However, the downside is the user is unable to undo their changes, i.e. the “Cancel” button does not work. In the screenshot below, a record that has changes made is indicated with a Pen icon. When the user moves to another record, the current record is updated.
The batch update pattern is similar to how Word, or Excel saves. All changes are discarded by default unless the user agrees to save changes.
The autosave to pending pattern can be observed in applications like WordPress, GMail, or Vim where pending changes are saved to a back up file in the background, so that the user can recover from lost-edits should a catastrophic error arise.
Consistency
It is not necessary for this pattern to be used consistently throughout a single application. The batch update pattern may be used when posting changes results in irreversible events, for instance, sending emails. Therefore, this pattern applies to forms, not an entire application.
About this entry
You’re currently reading “ 4GL Patterns #3 – Database Update Patterns ,” an entry on Chui's Counterpoint
- Published:
- 9.17.08 / 10pm
- Category:
- database

No comments
Jump to comment form | comments rss [?] | trackback uri [?]