in browser data stores

Post on 19-Jun-2015

597 Views

Category:

Technology

0 Downloads

Preview:

Click to see full reader

DESCRIPTION

London AJAX Conference, July 2010. An old talk about Dojo Data Stores.

TRANSCRIPT

In-Browser Data Stores

James Thomastwitter.com/thomasj

Dealing with data

Dealing with data•How do we store and access client-side data in long-lived apps?

Dealing with data•How do we store and access client-side data in long-lived apps?

•How do we maintain data consistency in-browser?

Dealing with data•How do we store and access client-side data in long-lived apps?

•How do we maintain data consistency in-browser?

•How do we migrate between data sources?

dojo.data"uniform data access layer that removes the concepts of database drivers, service endpoints, and unique data formats."

dojo.data"uniform data access layer that removes the concepts of database drivers, service endpoints, and unique data formats."

Standardised interfaces for all data access

•Read, Write, Identity, Notification•Stores, items and attributes

dojo.data.Read•Fetch store items•Retrieve item's attributes•Search for items matching query•and more......

dojo.data.Read

var store = new some.Datastore();

var gotItems = function(items, request){ console.log("Items located: " + items.length); };

store.fetch({onComplete: gotItems});

dojo.data.Write•Creating new items•Deleting an item•Updating an item•Saving series of creates, updates, deletes•Revert changes

dojo.data.Write

var store = new some.Datastore();

var gotItems = function(items, request){ for (var i = 0; i < items.length; i++){ var item = items[i]; store.setValue(item, "foo", "bar"); } store.save();};

store.fetch({onComplete: gotItems});

dojo.data.Identity & dojo.data.Notifications•Items have unique identifier

•Fetch items by unique key

•Emit notifications when items created, updated and deleted

dojo.data features

dojo.data features

•Asynchronous by default

dojo.data features

•Asynchronous by default

•"Store-centric" data view

dojo.data features

•Asynchronous by default

•"Store-centric" data view

•Interfaces are independent

dojo.data features

•Asynchronous by default

•"Store-centric" data view

•Interfaces are independent

•Notifications enable easy consistency

dojo.data stores

dojo.data stores

Need a custom store? Make your own!

dojo.data widgets•Lots of Dojo's UI widgets (Dijits) automatically work with stores

Dealing with data

Dealing with data•How do we store and access client-side data in long-lived apps?

Generic client-side data store

Dealing with data•How do we store and access client-side data in long-lived apps?

Generic client-side data store•How do we maintain data consistency in-browser?

Store generated event notifications

Dealing with data•How do we store and access client-side data in long-lived apps?

Generic client-side data store•How do we maintain data consistency in-browser?

Store generated event notifications •How do we migrate between data sources?

Uniform interface for data access

Questions?

top related