[dojo-contributors] dijit.Tree assumes datastore implements Identity API
Brian Douglas Skinner
skinner at dojotoolkit.org
Tue Aug 21 14:33:44 EDT 2007
Michael Smith wrote:
> While I wasn't involved in the initial decision to have a separate
> Identity API, I was under the impression that this was done because
> some datastores may have data that don't have IDs.
I think the original goal was just to keep the basic Read API as simple
as possible, to keep it easy to write new datastores. But
realistically, implementing the full Read API is now somewhat
complicated, and adding in Identity support would be fairly simple for
> But is there any case where a datastore may need to read data
> to which it can't apply Identities?
I think a datastore can probably always just make up a unique id for
each item, even if there's no unique id embedded in the data itself.
For example, a .csv file won't necessarily have an id column in the file
itself, but our dojox.data.CsvStore still provides a getIdentity()
implementation by just returning the row number of the item in the file.
More information about the dojo-contributors