<p dir="ltr">Cool,</p>
<p dir="ltr">Will take a look tomorrow</p>
<div class="gmail_quote">On Oct 30, 2013 7:25 PM, &quot;Lucas Holmquist&quot; &lt;<a href="mailto:lholmqui@redhat.com">lholmqui@redhat.com</a>&gt; wrote:<br type="attribution"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div style="word-wrap:break-word">I&#39;ve sent a PR for this here <a href="https://github.com/aerogear/aerogear-js/pull/68" target="_blank">https://github.com/aerogear/aerogear-js/pull/68</a><div><br></div><div>I&#39;m still working on unit tests,   but it would be nice to have some comments on implementation.</div>
<div><br></div><div>All existing code should work as before,  all the current unit tests code have not been modified and they all pass</div><div><br></div><div><br></div><div>I implemented option #2,  which is the &quot;do it for you&quot; option.  There is also a JIRA, <a href="https://issues.jboss.org/browse/AGJS-93" target="_blank">https://issues.jboss.org/browse/AGJS-93</a> , to revisit in the future to add more options</div>
<div><br></div><div><br><div><div>On Oct 30, 2013, at 9:04 AM, Lucas Holmquist &lt;<a href="mailto:lholmqui@redhat.com" target="_blank">lholmqui@redhat.com</a>&gt; wrote:</div><br><blockquote type="cite"><div style="word-wrap:break-word">
<br><div><div>On Oct 29, 2013, at 4:04 PM, Kris Borchers &lt;<a href="mailto:kris@redhat.com" target="_blank">kris@redhat.com</a>&gt; wrote:</div><br><blockquote type="cite"><div style="word-wrap:break-word"><br><div><div>
On Oct 29, 2013, at 2:52 PM, Lucas Holmquist &lt;<a href="mailto:lholmqui@redhat.com" target="_blank">lholmqui@redhat.com</a>&gt; wrote:</div><br><blockquote type="cite"><div style="word-wrap:break-word"><br><div><div>On Oct 28, 2013, at 10:27 AM, Matthias Wessendorf &lt;<a href="mailto:matzew@apache.org" target="_blank">matzew@apache.org</a>&gt; wrote:</div>
<br><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,  i&#39;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,  &quot;aysnc&quot;, the name is up for debate,  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 &quot;async&quot; ),  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 ? </div><div> </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&#39;m a user,  i create an IndexedDB store,  but the device/browser i&#39;m using doesn&#39;t support it.  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,  just like regular. And they need to &quot;opt-in&quot; to the fallback stuff.  this would be an option on the &quot;add&quot; of the Store.  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,  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&#39;d support the #2</div><div> </div></div></div></div></blockquote><div><br></div><div>anymore thoughts/comments on which fallback strategy should be used?</div></div></div></blockquote><div><br>
</div>I prefer #1 for flexibility but #2 for simplicity. Honestly there are pluses and minuses both ways. In the spirit of abstractj since either way is probably fine, I say follow your heart. ;)<br></div></div></blockquote>
<div><br></div><div>that was very helpful.  :)</div><div><br></div><div>i think for now,  i&#39;ll go with #2 for simplicity and create a JIRA to revisit and add the flexibility</div><div><br></div><div><br></div><br><blockquote type="cite">
<div style="word-wrap:break-word"><div><blockquote type="cite"><div style="word-wrap:break-word"><div><div><br></div><br><blockquote type="cite"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><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,  and a &quot;Asynchronous&quot; store falls back to a &quot;Synchronous&quot; one,  what should be returned.  I&#39;m thinking what ever the return value of the &quot;Async&quot; one was.<br>


<br>
I don&#39;t see this as breaking API since the &quot;sync&quot; store was not meant to be created &quot;directly&quot;<br>
<br>
So if they create an IndexedDB store and it fallbacks to a memory adapter,  this store will use the &quot;async&quot; model<br></blockquote><div><br></div><div>+1 makes sense</div><div>See question above :-)</div><div> </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" target="_blank">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" target="_blank">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></blockquote>
</div><br></div>_______________________________________________<br>aerogear-dev mailing list<br><a href="mailto:aerogear-dev@lists.jboss.org" target="_blank">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></blockquote>
</div><br></div>_______________________________________________<br>aerogear-dev mailing list<br><a href="mailto:aerogear-dev@lists.jboss.org" target="_blank">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></blockquote>
</div><br></div>_______________________________________________<br>aerogear-dev mailing list<br><a href="mailto:aerogear-dev@lists.jboss.org" target="_blank">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></blockquote>
</div><br></div></div><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>