Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  • we want to ability to update individual preferences. This may include updating, creating and deleting preferences. This might require multiple passes.
  • Since the update step might arbitrarily modify the preferences the store needs to be informed about the changes so that the update can be persisted.
  • preferences need to ability to reference each other. One way to achieve this is that separate instantiation and dependency resolutionThis is done by storing UUIDs. The objects using the preferences are responsible for resolving those references.

The first to points are the responsibility of the PreferenceStoreUpdater while the second should be performed by the PreferenceStoreRecoverer.While not part of this specification the recoverer should probably go through these

stepsThe recoverer is responsible for

  1. Convert PreferenceRecord to PreferenceAttach Preference to AbstractConfiguredObject
  2. Convert generic attributes to a type specific PreferenceValue
  3. Cross link to other preferencesAttach Preference to AbstractConfiguredObject
Code Block
languagejava
interface PreferenceStoreUpdater
{
    Collection<PreferenceRecord> updatePreferences(String currentVersion, Collection<PreferenceRecord> preferences);
    String getLatestVersion();
}

interface PreferenceStoreRecoverer
{
	void recoverPreferences(Collection<PreferenceRecord> preferences);
}

Persistence

Preferences are considered immutable. All changes to preferences should go through a UserPreferences facade which is responsible for updating the store.

...