Skip to content

About Diffs

mikeconley edited this page Oct 19, 2012 · 6 revisions

When changes to a contact (or a record) are written, it is done via a diff.

So, the user alters contact X in the UI by adding some fields, removing fields, and changing fields. These additions, removals and changes are represented as a diff D.

Ensemble then takes the diff, applies it to the contact record, and saves it in the database.

Why?

There are a few reasons:

  1. It's an easy way to communicate to a connector that "these are things I want to change about a record", which can be applied to cached records - even if those cached records have been updated since the diff was created.
  2. Some contact providers will be read-only. This means that their records can potentially cease resembling the associated contact in Ensemble. Changes to those read-only contacts, however, should still manifest within Ensemble. This change can be manifested easily with a diff.
  3. Easy undo - diffs are easy to invert, so it's easy to have a stack of inverted diffs to perform undo operations.

Clone this wiki locally