<html><head><meta http-equiv="Content-Type" content="text/html charset=iso-8859-1"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><br><div><div>On Oct 28, 2013, at 10:27 AM, Matthias Wessendorf &lt;<a href="mailto:matzew@apache.org">matzew@apache.org</a>&gt; wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div dir="ltr"><br><div class="gmail_extra"><br><br><div class="gmail_quote">On Mon, Oct 28, 2013 at 2:10 PM, Lucas Holmquist <span dir="ltr">&lt;<a href="mailto:lholmqui@redhat.com" target="_blank">lholmqui@redhat.com</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hello Everybody,<br>
<br>
Now that we have support for IndexedDB and WebSQL in our Javascript library, &nbsp;i've started a fallback strategy for DataManager.<br>
<br>
There will need to be a bit of deprecation since the 2 new adapters are asynchronous and return a promise/callbacks and the other adapters are synchronous and return the actual data.<br>
<br>
We are thinking of adding an option, &nbsp;"aysnc", the name is up for debate, &nbsp;which would only be valid for the memory and session/local adapters and would default to false and things would return as normal( this would also be removed in the next release and everything would be "async" ), &nbsp;but if true, then these adapters would return like the 2 new adapters, using callbacks/promises.<br>
</blockquote><div><br></div><div>could we make it async only ?&nbsp;</div></div></div></div></blockquote><div><br></div><div>it would be once we get to 1.4.0(?) since we need to deprecate</div><div><br></div><br><blockquote type="cite"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><div>&nbsp;</div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
<br>
Now on to the Fallback Strategy:<br>
<br>
Here is a use case:<br>
<br>
I'm a user, &nbsp;i create an IndexedDB store, &nbsp;but the device/browser i'm using doesn't support it. &nbsp;I think there are 2 options we can go down here<br>
<br>
<br>
1. The user gets an error back about IndexedDB being not support, &nbsp;just like regular. And they need to "opt-in" to the fallback stuff. &nbsp;this would be an option on the "add" of the Store. &nbsp;Maybe the actual Constructor?<br>

They would also be able to provide a list of adapters to try which would override our predefined list.<br>
<br>
<br>
2. Fallback is assumed and there is no option, &nbsp;it just happens, using our predefined list.<br></blockquote><div><br></div><div><br></div><div>I think it would be nice if the fallback just happens; However, there might be the case that folks have a certain preference in actually specifying the option. Not sure.</div>
<div>As of now I think I'd support the #2</div><div>&nbsp;</div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
<br>
There is still the question of if the fallback is used, &nbsp;and a "Asynchronous" store falls back to a "Synchronous" one, &nbsp;what should be returned. &nbsp;I'm thinking what ever the return value of the "Async" one was.<br>

<br>
I don't see this as breaking API since the "sync" store was not meant to be created "directly"<br>
<br>
So if they create an IndexedDB store and it fallbacks to a memory adapter, &nbsp;this store will use the "async" model<br></blockquote><div><br></div><div>+1 makes sense</div><div>See question above :-)</div><div>&nbsp;</div>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
<br>
Thoughts, comments, cat pictures,<br>
<br>
-Luke<br>
<br>
<br>
<br>
<br>
_______________________________________________<br>
aerogear-dev mailing list<br>
<a href="mailto:aerogear-dev@lists.jboss.org">aerogear-dev@lists.jboss.org</a><br>
<a href="https://lists.jboss.org/mailman/listinfo/aerogear-dev" target="_blank">https://lists.jboss.org/mailman/listinfo/aerogear-dev</a><br>
</blockquote></div><br><br clear="all"><div><br></div>-- <br>Matthias Wessendorf <br><br>blog: <a href="http://matthiaswessendorf.wordpress.com/" target="_blank">http://matthiaswessendorf.wordpress.com/</a><br>sessions: <a href="http://www.slideshare.net/mwessendorf" target="_blank">http://www.slideshare.net/mwessendorf</a><br>
twitter: <a href="http://twitter.com/mwessendorf" target="_blank">http://twitter.com/mwessendorf</a>
</div></div>
_______________________________________________<br>aerogear-dev mailing list<br><a href="mailto:aerogear-dev@lists.jboss.org">aerogear-dev@lists.jboss.org</a><br>https://lists.jboss.org/mailman/listinfo/aerogear-dev</blockquote></div><br></body></html>