<br><br>On Tuesday, February 24, 2015, Lucas Holmquist &lt;<a href="mailto:lholmqui@redhat.com">lholmqui@redhat.com</a>&gt; wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word"><p style="margin:1.2em 0px 1.6em;color:rgb(36,38,40);font-family:&#39;Open Sans&#39;,sans-serif;font-size:18.1887989044189px;line-height:27.2831993103027px;background-color:rgb(255,255,255)"><span style="font-size:18.1887989044189px;line-height:27.2831993103027px">While i was getting things together for the 2.1.0 release, I started to think about the structure of AeroGear.js.</span></p><p style="margin:1.2em 0px 1.6em;color:rgb(36,38,40);font-family:&#39;Open Sans&#39;,sans-serif;font-size:18.1887989044189px;line-height:27.2831993103027px;background-color:rgb(255,255,255)">Lets take DataManager as an example.</p><pre style="font-family:Inconsolata,monospace;font-size:0.9em;margin-top:1.6em;margin-bottom:1.6em;border:1px solid rgb(221,219,204);width:671.34375px;padding:10px;overflow:auto;border-top-left-radius:3px;border-top-right-radius:3px;border-bottom-right-radius:3px;border-bottom-left-radius:3px;color:rgb(36,38,40);line-height:27.2831993103027px;background-color:rgb(241,240,234);background-repeat:initial initial"><code style="font-family:Inconsolata,monospace;font-size:inherit;white-space:pre-wrap;border:none;border-radius:2px;padding:0px;background:transparent">var dataManager = new AeroGear.DataManager();
</code></pre><p style="margin:1.2em 0px 1.6em;color:rgb(36,38,40);font-family:&#39;Open Sans&#39;,sans-serif;font-size:18.1887989044189px;line-height:27.2831993103027px;background-color:rgb(255,255,255)">Basically, the resulting <code style="font-family:Inconsolata,monospace;font-size:0.85em;white-space:pre-wrap;border:1px solid rgb(221,219,204);border-radius:2px;padding:1px 3px;background:rgb(241,240,234)">datamanger</code> object is a fancy array. We can add new <code style="font-family:Inconsolata,monospace;font-size:0.85em;white-space:pre-wrap;border:1px solid rgb(221,219,204);border-radius:2px;padding:1px 3px;background:rgb(241,240,234)">stores</code> to it:</p><pre style="font-family:Inconsolata,monospace;font-size:0.9em;margin-top:1.6em;margin-bottom:1.6em;border:1px solid rgb(221,219,204);width:671.34375px;padding:10px;overflow:auto;border-top-left-radius:3px;border-top-right-radius:3px;border-bottom-right-radius:3px;border-bottom-left-radius:3px;color:rgb(36,38,40);line-height:27.2831993103027px;background-color:rgb(241,240,234);background-repeat:initial initial"><code style="font-family:Inconsolata,monospace;font-size:inherit;white-space:pre-wrap;border:none;border-radius:2px;padding:0px;background:transparent">dataManager.add(&#39;memoryStoreThing&#39;);

dataManager.add({{
    name: &quot;indexDBStore&quot;,
    type: &quot;IndexedDB&quot;
}});
</code></pre><p style="margin:1.2em 0px 1.6em;color:rgb(36,38,40);font-family:&#39;Open Sans&#39;,sans-serif;font-size:18.1887989044189px;line-height:27.2831993103027px;background-color:rgb(255,255,255)">I&#39;m not sure what the reason for this was historically. I think this concept was initally created when we were doing Pipeline.</p><p style="margin:1.2em 0px 1.6em;color:rgb(36,38,40);font-family:&#39;Open Sans&#39;,sans-serif;font-size:18.1887989044189px;line-height:27.2831993103027px;background-color:rgb(255,255,255)">But sticking to this example, i&#39;m wondering if it adds any value though. would someone create a Datamanager that has more than one store in it? It&#39;s possible i guess if someone wanted to store the same info in a IndexedDB and WebSQL database at the same, for example, but there is currently no way to sync data between the two</p><p style="margin:1.2em 0px 1.6em;color:rgb(36,38,40);font-family:&#39;Open Sans&#39;,sans-serif;font-size:18.1887989044189px;line-height:27.2831993103027px;background-color:rgb(255,255,255)">With the next release, 2.1.0, we will be deprecating Notifier, which uses this pattern.</p><p style="margin:1.2em 0px 1.6em;color:rgb(36,38,40);font-family:&#39;Open Sans&#39;,sans-serif;font-size:18.1887989044189px;line-height:27.2831993103027px;background-color:rgb(255,255,255)">So Datamanager and Sync would be the only things using this pattern. Which i&#39;m not sure makes sense anymore.</p><p style="margin:1.2em 0px 1.6em;color:rgb(36,38,40);font-family:&#39;Open Sans&#39;,sans-serif;font-size:18.1887989044189px;line-height:27.2831993103027px;background-color:rgb(255,255,255)"><span style="font-size:15px;font-family:&#39;Helvetica Neue&#39;,Helvetica,Arial,sans-serif"></span></p></div></blockquote><div><br></div><div>I agree</div><div><br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word"><p style="margin:1.2em 0px 1.6em;color:rgb(36,38,40);font-family:&#39;Open Sans&#39;,sans-serif;font-size:18.1887989044189px;line-height:27.2831993103027px;background-color:rgb(255,255,255)"><span style="font-size:15px;font-family:&#39;Helvetica Neue&#39;,Helvetica,Arial,sans-serif"> </span></p></div></blockquote><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word"><p style="margin:1.2em 0px 1.6em;color:rgb(36,38,40);font-family:&#39;Open Sans&#39;,sans-serif;font-size:18.1887989044189px;line-height:27.2831993103027px;background-color:rgb(255,255,255)">The remaining parts of the Library, Crypto, UnifiedPush, and to some extent SimplePush(currenlty coupled with Notifier) don&#39;t do this.</p><p style="margin:1.2em 0px 1.6em;color:rgb(36,38,40);font-family:&#39;Open Sans&#39;,sans-serif;font-size:18.1887989044189px;line-height:27.2831993103027px;background-color:rgb(255,255,255)">I am leaning toward proposing we get rid of this pattern and just make a DataManager object hold 1 store/adapter( sync woud follow suit )</p><p style="margin:1.2em 0px 1.6em;color:rgb(36,38,40);font-family:&#39;Open Sans&#39;,sans-serif;font-size:18.1887989044189px;line-height:27.2831993103027px;background-color:rgb(255,255,255)">This change though would be a 3.0 thing since it would be changing the way the API works.</p></div></blockquote><div><br></div><div>yeah, lets do that for 3.0</div><div><br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word"><p style="margin:1.2em 0px 1.6em;color:rgb(36,38,40);font-family:&#39;Open Sans&#39;,sans-serif;font-size:18.1887989044189px;line-height:27.2831993103027px;background-color:rgb(255,255,255)">I&#39;m also wondering if it would make sense to separate the differnt parts of the library into different repo&#39;s.</p></div></blockquote>worth to evaluate this<br><div><br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word"><p style="margin:1.2em 0px 1.6em;color:rgb(36,38,40);font-family:&#39;Open Sans&#39;,sans-serif;font-size:18.1887989044189px;line-height:27.2831993103027px;background-color:rgb(255,255,255)">I think one of the main reasons this wasn&#39;t done in the past was because <code style="font-family:Inconsolata,monospace;font-size:0.85em;white-space:pre-wrap;border:1px solid rgb(221,219,204);border-radius:2px;padding:1px 3px;background:rgb(241,240,234)">AeroGear.Core</code> was shared across many pieces of the library and it would be a lot of code duplication.</p></div></blockquote><div>but we could get it via dependency, right?</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word"><p style="margin:1.2em 0px 1.6em;color:rgb(36,38,40);font-family:&#39;Open Sans&#39;,sans-serif;font-size:18.1887989044189px;line-height:27.2831993103027px;background-color:rgb(255,255,255)">But something like the UnifiedPush Client SDK, might make sense in a separate repo.</p></div></blockquote><div>I like this approach <span></span></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word"><p style="margin:1.2em 0px 1.6em;color:rgb(36,38,40);font-family:&#39;Open Sans&#39;,sans-serif;font-size:18.1887989044189px;line-height:27.2831993103027px;background-color:rgb(255,255,255)">For distribution, i&#39;ve actually created a AeroGear Component GH organization, that has pieces of the library, <a href="https://github.com/orgs/AeroGear-Components/dashboard" style="color:rgb(91,164,229)" target="_blank">https://github.com/orgs/AeroGear-Components/dashboard</a></p><p style="margin:1.2em 0px 1.6em;color:rgb(36,38,40);font-family:&#39;Open Sans&#39;,sans-serif;font-size:18.1887989044189px;line-height:27.2831993103027px;background-color:rgb(255,255,255)">I think i&#39;ve started to ramble, so i&#39;ll stop here and look for comments</p></div></blockquote><br><br>-- <br>Sent from Gmail Mobile<br>