Closed Bug 968734 Opened 10 years ago Closed 10 years ago

Data Store API: provide a label to categorize data stores

Categories

(Core :: DOM: Core & HTML, defect)

defect
Not set
normal

Tracking

()

RESOLVED WONTFIX

People

(Reporter: airpingu, Unassigned)

References

()

Details

After discussion back and forth with other editors [1], we hope to add a new property |label| to categorize the data stores and use the original |name| to identify the data stores, so that the getDataStores("foo") will return an array of data stores that are labeled (categorized) as "foo".

For example, we can have the following data stores related to the messaging purpose:

  label: "messaging"
  name: "messaging-sms-sim-1"

  label: "messaging"
  name: "messaging-sms-sim-2"

  label: "messaging"
  name: "messaging-mms-sim-1"

  label: "messaging"
  name: "messaging-mms-sim-2"

Such that we can formally define the keyword "messaging" in the Messaging API spec as below:

"Use getDataStores("messaging") to retrieve all the data stores that save messaging-related messages, like SMS or MMS. It's up to platform's implementation to decide whether or not to separate data stores to save different types of messages or different sources of messages. For example, SMS can be saved in one data store and MMS can be saved in another one; or just use single one to save both."

https://github.com/airpingu/data-store-api/issues/1
Using "label" is the current W3C proposal agreed with other editors. We thought this can add more flexibilities to manage the data stores, which is especially useful when we want to maintain diverge data in different stores but they still have the similar purpose.
It seems to me that 'label' is == to what we call 'name'. and 'name' is a unique name chosen by the app.
What we use to make DataStores unique is the manifestURL but a label is more friendly.
Sounds good to me.
Yes! And I think we can directly do:

1. Add an extra label attribute (equals to the existing name) in our current manifest.
2. Add an extra label attribute in the interface DataStore.
3. Promise getDataStores (s/name/label);

to make changes with backward compatibilities.
(In reply to Andrea Marchesini (:baku) from comment #2)
> It seems to me that 'label' is == to what we call 'name'. and 'name' is a
> unique name chosen by the app.
> What we use to make DataStores unique is the manifestURL but a label is more
> friendly.
> Sounds good to me.

Eventually, we figured out the "label" doesn't help a lot because ("name" + "owner") already play a similar role. However, we hope to rename "name" to "type", because the "name" of data store sounds to be unique. "type" makes more sense.

So, close this bug as wonfix and I'll fire another bug to address the rename for s/name/type.

Btw, Andrea, Zoltan wants to say hi to you. He said you used to be colleagues in Intel. ;)
Status: NEW → RESOLVED
Closed: 10 years ago
Resolution: --- → WONTFIX
Component: DOM → DOM: Core & HTML
You need to log in before you can comment on or make changes to this bug.