<html><head><meta http-equiv="Content-Type" content="text/html charset=us-ascii"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><p style="margin: 1.2em 0px 1.6em; color: rgb(36, 38, 40); font-family: 'Open Sans', sans-serif; font-size: 18.1887989044189px; line-height: 27.2831993103027px; background-color: rgb(255, 255, 255);" class=""><span style="font-size: 18.1887989044189px; line-height: 27.2831993103027px;" class="">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: 'Open Sans', sans-serif; font-size: 18.1887989044189px; line-height: 27.2831993103027px; background-color: rgb(255, 255, 255);" class="">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; box-sizing: border-box; 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-position: initial initial; background-repeat: initial initial;" class=""><code style="font-family: Inconsolata, monospace; font-size: inherit; white-space: pre-wrap; border: none; border-radius: 2px; padding: 0px; background: transparent;" class="">var dataManager = new AeroGear.DataManager();
</code></pre><p style="margin: 1.2em 0px 1.6em; color: rgb(36, 38, 40); font-family: 'Open Sans', sans-serif; font-size: 18.1887989044189px; line-height: 27.2831993103027px; background-color: rgb(255, 255, 255);" class="">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);" class="">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);" class="">stores</code> to it:</p><pre style="font-family: Inconsolata, monospace; font-size: 0.9em; margin-top: 1.6em; margin-bottom: 1.6em; box-sizing: border-box; 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-position: initial initial; background-repeat: initial initial;" class=""><code style="font-family: Inconsolata, monospace; font-size: inherit; white-space: pre-wrap; border: none; border-radius: 2px; padding: 0px; background: transparent;" class="">dataManager.add('memoryStoreThing');
dataManager.add({{
name: "indexDBStore",
type: "IndexedDB"
}});
</code></pre><p style="margin: 1.2em 0px 1.6em; color: rgb(36, 38, 40); font-family: 'Open Sans', sans-serif; font-size: 18.1887989044189px; line-height: 27.2831993103027px; background-color: rgb(255, 255, 255);" class="">I'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: 'Open Sans', sans-serif; font-size: 18.1887989044189px; line-height: 27.2831993103027px; background-color: rgb(255, 255, 255);" class="">But sticking to this example, i'm wondering if it adds any value though. would someone create a Datamanager that has more than one store in it? It'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: 'Open Sans', sans-serif; font-size: 18.1887989044189px; line-height: 27.2831993103027px; background-color: rgb(255, 255, 255);" class="">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: 'Open Sans', sans-serif; font-size: 18.1887989044189px; line-height: 27.2831993103027px; background-color: rgb(255, 255, 255);" class="">So Datamanager and Sync would be the only things using this pattern. Which i'm not sure makes sense anymore.</p><p style="margin: 1.2em 0px 1.6em; color: rgb(36, 38, 40); font-family: 'Open Sans', sans-serif; font-size: 18.1887989044189px; line-height: 27.2831993103027px; background-color: rgb(255, 255, 255);" class="">The remaining parts of the Library, Crypto, UnifiedPush, and to some extent SimplePush(currenlty coupled with Notifier) don't do this.</p><p style="margin: 1.2em 0px 1.6em; color: rgb(36, 38, 40); font-family: 'Open Sans', sans-serif; font-size: 18.1887989044189px; line-height: 27.2831993103027px; background-color: rgb(255, 255, 255);" class="">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: 'Open Sans', sans-serif; font-size: 18.1887989044189px; line-height: 27.2831993103027px; background-color: rgb(255, 255, 255);" class="">This change though would be a 3.0 thing since it would be changing the way the API works.</p><p style="margin: 1.2em 0px 1.6em; color: rgb(36, 38, 40); font-family: 'Open Sans', sans-serif; font-size: 18.1887989044189px; line-height: 27.2831993103027px; background-color: rgb(255, 255, 255);" class="">I'm also wondering if it would make sense to separate the differnt parts of the library into different repo's.</p><p style="margin: 1.2em 0px 1.6em; color: rgb(36, 38, 40); font-family: 'Open Sans', sans-serif; font-size: 18.1887989044189px; line-height: 27.2831993103027px; background-color: rgb(255, 255, 255);" class="">I think one of the main reasons this wasn'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);" class="">AeroGear.Core</code> was shared across many pieces of the library and it would be a lot of code duplication.</p><p style="margin: 1.2em 0px 1.6em; color: rgb(36, 38, 40); font-family: 'Open Sans', sans-serif; font-size: 18.1887989044189px; line-height: 27.2831993103027px; background-color: rgb(255, 255, 255);" class="">But something like the UnifiedPush Client SDK, might make sense in a separate repo.</p><p style="margin: 1.2em 0px 1.6em; color: rgb(36, 38, 40); font-family: 'Open Sans', sans-serif; font-size: 18.1887989044189px; line-height: 27.2831993103027px; background-color: rgb(255, 255, 255);" class="">For distribution, i'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); -webkit-transition: all 0.15s ease-in-out; transition: all 0.15s ease-in-out;" class="">https://github.com/orgs/AeroGear-Components/dashboard</a></p><p style="margin: 1.2em 0px 1.6em; color: rgb(36, 38, 40); font-family: 'Open Sans', sans-serif; font-size: 18.1887989044189px; line-height: 27.2831993103027px; background-color: rgb(255, 255, 255);" class="">I think i've started to ramble, so i'll stop here and look for comments</p></body></html>