W3C home > Mailing lists > Public > public-sysapps@w3.org > February 2014

RE: W3C Working Draft for Data Store API

Date: Tue, 11 Feb 2014 09:47:21 +0000
To: "Kis, Zoltan" <zoltan.kis@intel.com>, Gene Lian <clian@mozilla.com>
Cc: "public-sysapps@w3.org" <public-sysapps@w3.org>, Ehsan Akhgari <ehsan@mozilla.com>, Andrew Overholt <overholt@mozilla.com>, Jonas Sicking <jonas@sicking.cc>
Message-id: <A52BC7FE998B7E43BB74213DE5CD36905C3850F1@EX10-MB2-MAD.hi.inet>
Hi Zoltan,

On 11 feb 2014 at 09:18:41, Kis, Zoltan wrote:
> Hi Eduardo,
> On Tue, Feb 11, 2014 at 9:02 AM, Gene Lian <clian@mozilla.com> wrote:
>> Hi Eduardo!
>> ----- Original Message -----
>>> From: "EDUARDO FULLEA CARRERA" <efc@tid.es> To: "Gene Lian"
>>> <clian@mozilla.com> Cc: public-sysapps@w3.org, "Ehsan Akhgari"
>>> <ehsan@mozilla.com>, "Andrew Overholt" <overholt@mozilla.com>, "Jonas
>>> Sicking" <jonas@sicking.cc> Sent: Thursday, February 6, 2014 10:47:43
>>> PM Subject: RE: W3C Working Draft for Data Store API
>>> It is ok to have to separate operations but in order to avoid duplicated
>>> operations we could drop 'add' with 'id' as argument and stick to:
>>> update (data, id)
>>> add (data)
>> Yeap! I doubt the same thing. I'll ask around why Mozilla separates
>> this in the first design.
> I thought we have discussed that in
> https://github.com/airpingu/data-store-api/issues/12

> Giving it a second thought, let's start from use cases.
> There are 3 different data adding use cases one would possibly like
> DataStore to handle:
> 1. update data with a given id; if the id does not exist, fail.
> 2. insert data; a new id is returned on success, else fail.
> 3. insert data if it does not exist; if it exists, then update it.
> The first 2 are trivial. The third has some challenge about how to
> formalize, and how to implement it. One example was given as inserting
> URL's in a DB, if they did not exist in the DB. This would not need
> the update part: if the data exists, just don't add. On the other
> hand, one knows the content, but not the id. So if we support 3., we
> need a way to specify "if data exists". In most cases that can be
> reduced to an id/primary key, but in some cases the content matters.
> IMO a generic way to deal with this would be the following:
> Promise<index> add(any data, DOMString[] props);

Not sure the benefits of case 3 are worth the complexity. Is there a real demand for that?
In any case we may want to separate (and probably rename) the function from the regular add (case 2)


Este mensaje se dirige exclusivamente a su destinatario. Puede consultar nuestra política de envío y recepción de correo electrónico en el enlace situado más abajo.
This message is intended exclusively for its addressee. We only send and receive email on the basis of the terms set out at:

Received on Tuesday, 11 February 2014 09:47:51 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 6 January 2015 20:36:19 UTC