[Sugar-devel] On datastore object IDs

Eben Eliason eben at laptop.org
Thu Jul 2 12:46:47 EDT 2009


On Thu, Jul 2, 2009 at 12:35 PM, Benjamin M.
Schwartz<bmschwar at fas.harvard.edu> wrote:
> We've been talking a lot about how datastore version 3 (?) should be
> structured.  I'd like to propose (purely to initiate discussion) that it
> be structured as follows:
>
> The datastore is a collection of objects, which are arranged into version
> trees.  Each object has a tree_id, which is an arbitrary unique identifier
> (string) for the version tree.  The datastore will generate a new tree_id
> each time a new tree is created.  Each object also has a version_id, which
> indicates the object's place in the tree.  The version_id could take the
> form of a dotted decimal string like "4.5.2.1".

This sounds great. tree_id is far more clear.

> Some objects are Actions, and some objects are Documents.  Each Action
> must retain a list to all Documents associated with that Action, each
> represented as a (tree_id, version_id) pair.  Each Document must retain a
> reference to the Action with which it is associated, represented as a
> (tree_id, version_id) pair.  Each Document is only associated with a
> single Action; a new Action that uses a Document must always make a new
> version.

I disagree with this last statement. Consider the following 2 actions:

1. Painted a picture of [a tree]
2. Sent [a tree] to [friend]

Both of these actions refer to the same Document, and more
specifically, to the same (tree_id, version_id) pair. It seems that a
Document should retain a list of all actions which reference it.

> To implement the concepts present in the current datastore, activity_id
> would actually be the tree_id of an Action, and object_id would be the
> (tree_id, version_id) pair of a Document.

Makes sense.

Eben


More information about the Sugar-devel mailing list