Data API Overview
The most basic atom of the dojo.data API is called an
item, which is composed of key/value pairs called
attributes and attribute
values in dojo.data
parlance; conceptually, you can think of an item as a plain old
JavaScript Object. However,
although the underlying implementation may very well be a JavaScript
Object, be careful to use the
provided APIs for accessing it, as the internal representation may be
something entirely different. For example, some data abstractions may
use a DOM model for storing certain types of data for efficiency
reasons, or lazy-load data on the fly even though it seems like it's
already local. In cases like these, accessing an item like a plain old
JavaScript object would likely cause an unexpected error. We'll come
back to specific API calls for accessing an item in the next
section.
Tip
Saying that an item has an attribute—but no value for the attribute—is the same as saying that the item doesn't have the attribute at all. In other words, it's nonsensical to think about having an attribute with no value because attributes inherently have a specific state.
Before getting into the capabilities of any one specific API,
it's helpful to survey the landscape. Here's an overview of the
various dojo.data APIs with a brief
summary of what these APIs provide to the application developer. These
APIs are interfaces, not implementations; any concrete dojo.data data store
would define one or more of the upcoming APIs:
dojo.data.api.ReadProvides a uniform ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access