[dojo-contributors] Dojo 1.9 Proposal

Kenneth G. Franqueiro kgf at dojotoolkit.org
Tue Oct 16 11:10:01 EDT 2012

As with the last time the idea of web storage + dojo/store was brought
up, I would raise concern at the idea of introducing this "feature".  I
may not have the most informed of opinions on the matter, but the
following things stick out to me:

* Which way would we "solve" this?  One write per atomic store
operation, or have developers call a method to persist all items at
once?  (Based on your idea of using Cache, I'm guesing the former; I'm
inclined to expect that the latter may actually perform better - i.e.
write all data to one key at once.)
* But moreover, who's to say we really have the right to prescribe one
or the other for every situation, when in reality it would take someone
very few lines of code to implement either approach him/herself?
* Performance implications (see perhaps
and in particular, the first link in the footnotes)
* Now you're also raising the implication of affecting another API
(dojo/store/Cache) just for the sake of a single implementation, which
to me sounds suspect (let alone that the potential implementation in
question also sounds suspect to begin with).  I'm also not really sure I
understand what kind of changes you have in mind.


On 10/16/2012 9:47 AM, Kitson Kelly wrote:
> All:
> Dylan mentioned this that he would like to see some functionality along
> this line in Dojo 1.9.  After having recently dug into a few things in
> the related area, I feel comfortable enough bringing forward a proposal
> for dojo/store/WebStorage for Dojo 1.9.
> dojo/store/WebStorage would provide an interface to HTML5's Web Storage
> API (http://dev.w3.org/html5/webstorage/).  This would provide the same
> API interface as dojo/store but in addition provide a mechanism (yet to
> be determined) to allow management of local and remote persistence of
> data, so the end developer could seamlessly integrate with the storage,
> including supporting an offline mode, without having to worry about the
> specific details of the implementation.
> This may require enhancements to dojo/store/Cache, as the mediation
> mechanism might be best placed within there to figure out how objects
> are persisted between stores.  So in theory, something like the
> following would work:
>     require(["dojo/store/JsonRest", "dojo/store/WebStorage",
>     "dojo/store/Cache"],
>     function(JsonRest, WebStorage, Cache){
>       var jsonStore = new JsonRest({
>         target: "/items/"
>       });
>       var webStore = new WebStorage({});
>       var store = new Cache(jsonStore, webStore, { ... });
>     });
> The plan would be for me to work with Kris Zyp (and others) and be
> informed by Persevere <http://www.persvr.org/>.
> Feel free to provide any thoughts/feedback on the proposal and I will be
> prepared to discuss further during the weekly meeting.
> Regards,
> Kit
> _______________________________________________
> dojo-contributors mailing list
> dojo-contributors at mail.dojotoolkit.org
> http://mail.dojotoolkit.org/mailman/listinfo/dojo-contributors

More information about the dojo-contributors mailing list