On May 20, 2013 6:10 AM, "Ben Kelly" <
bke...@mozilla.com> wrote:
>
> On May 20, 2013, at 4:54 AM, JOSE MANUEL CANTERA FONSECA <
jm...@tid.es> wrote:
> > I believe the current plan for the Contacts API is to enable DataStores
> > and as a result allow apps to cache whatever data they want for a
> > particular UI. Thus, it would make unnecessary the summaries approach
>
> Thanks for the information Jose. I had not seen that anywhere previously. I had also been speaking with Gregor about ContactsAPI and he had not mentioned it to me. (Or I missed it in the firehose of new information the last few weeks.)
>
> Mounir also said something similar in the bug:
>
> > Ben, we hope to have the Contacts API on top of a DataStore [1] and that should move the issue you are trying to fix to the application context instead of the platform one. In other words, applications would be able to arrange their data the way they want so they will be able to optimize things for their use cases.
> >
> > [1]
> >
https://bugzilla.mozilla.org/show_bug.cgi?id=871445
>
> These responses do raise some questions for me, though. I'm probably just confused on things, so I thought I would ask here rather than clutter the bug history. Sorry if these are stupid questions, but I just want to make sure I understand:
>
> 1) Are we no longer working to improve the core WebAPIs such as ContactsAPI?
We definitely should improve the contracts API where we see fit.
However knowing that the current medium/long term plan will fix this
particular issue means that it may not be worth doing through other
mechanisms.
I.e. if we can easily get performance, or other, wins, then we should
by all means do it. But if it's too much work, or if the goal is
simply to create a cleaner API, then it may not be worth it.
> 2) Are we pursuing a general application caching approach because we believe its technically impossible to make APIs like ContactsAPI performant for common use cases with the IPC-oriented architecture on this hardware?
I just don't see how the current approach can be kept application
agnostic while also high performance.
For example I think if we were to really benefit from the proposal in
the beginning of this thread, we should probably have a separate table
in the back-end database that only contains last-name and first-name.
But that's likely to be pretty application specific and other
applications want last-name, first-name and telephone number.
The only solution I've been able to think of is to have applications
either cache data themselves, or have them tell the implementation
exactly which indexes/mini-tables/groupings etc to store.
> 3) How does this impact the overarching strategic goal of developing standard APIs for mobile? Requiring secondary APIs to effectively use core APIs would seem to reduce their appeal.
Creating something that we can standardize is exactly the goal. See
https://wiki.mozilla.org/WebAPI/DataStore#Why_not_use_specific_APIs_for_the_use-cases_like_the_existing_Contacts_and_SMS.2FMMS_APIs.3F
> 4) What makes improvements to ContactsAPI mutually exclusive with the DataStore caching approach? In this case it would seem they could work in concert to further reduce workload on the device.
It's not mutually exclusive. But if we're going to be replacing the
Contacts API largely with the DataStore API, then features added to
the Contacts API will eventually be removed along with the rest of the
Contacts API.
/ Jonas