Deltas vs. Change sets
Last updated at 8:18 am UTC on 2 November 2007
What do deltas have that change sets don't?
- Deltas have lots of tests.
- Deltas are Rich. Change sets contain two kinds of entities: method definitions, and do-it's (the .changes file additionally provides some logging support). Deltas, on the other hand, model many types of changes:
- method definitions
- class comments
- instance variables
- class categories
- There can be multiple Deltas "logging" simultaneously instead of just one. We don't (redundantly) keep track of which ones they are outside of the standard notifier mechanism.
- A Delta uses a flat sequence (OrderedCollection) of so called Changes (formerly named "Actions", but "Changes" is a better name) to represent each actual fine granular code change. Each such change corresponds more or less with one notification from SystemChangeNotifier. In contrast ChangeSet uses a Dictionary of ClassChangeRecord instances grouping changes per class.
- Deltas allow cherry-picking at all stages of its life. While a delta is logging, it could be configured to log only changes to a particular package, or changes to unit tests, or other conditions. Deltas can be pieced together from other deltas, from the image, or from the user directly modifying them. A user can selectively apply or revert individual changes in a delta, or chunks of changes. (This is just barely implemented)
- Each Change records all its state including the state before the change, in an easily serializable way (it does not hold onto classes for example). Thus for example, a DSChangeClassCommentAction holds both the old and the new comment and the class name it refers to.
- Given the above each Change can create its corresponding anti Change. Applying the change and then its anti change should leave you with an image in its original state.
- Deltas know nothing about isolation features for Projects like ChangeSets do.
- Changes are more clearly defined, for example there are separate change classes for changing inst vars, changing class vars, changing the superclass etc etc, and not just a single "class def changed".
- Handles class renames gracefully - a class rename is an explicit change object.
- Condensing (removing redundant changes, addition followed by removal and so on) of Changes is an explicit operation and not done "on the fly" as ChangeSet does. This means that a Delta is a "true log" until you normalize it.
- A Delta has a UUID.
- A Delta has an attributes Dictionary to be able to handle more arbitrary info fields without requiring new code.
- ...and probably more we have missed.