W3C home > Mailing lists > Public > public-device-apis@w3.org > December 2009

Re: [contacts] Comments on editors draft of Contacts API

From: Dominique Hazael-Massieux <dom@w3.org>
Date: Tue, 01 Dec 2009 09:24:22 +0100
To: Robin Berjon <robin@robineko.com>
Cc: "richard.tibbett" <richard.tibbett@orange-ftgroup.com>, public-device-apis <public-device-apis@w3.org>
Message-ID: <1259655862.12376.530.camel@localhost>
Le lundi 30 novembre 2009 à 18:26 +0100, Robin Berjon a écrit :
> Actually, it could work without an interface (and whenever we can do
> without these we should — keep in mind that they pollute the global
> namespace). We could just have:
>   var c = myContacts.add({ name: "Pink Unicorn", urls:
> ["http://shiny-donkey.com/"]});
> The object that is passed is essentially treated as a Contact object —
> there is no need to create it. Functionally we get the same thing,
> without pollution. It's much cleaner.

I agree it is cleaner, but I only see working it out for relatively
simple and flat structures — given that the currently proposed Contact
object has sub-structures, and a fairly large number of fields, I’m not
sure it’s entirely realistic.

I guess the factory method could take a single parameter for the name
(since that’s currently the only required attribute), and let the others
be completed through attributes setting.

Received on Tuesday, 1 December 2009 08:24:50 UTC

This archive was generated by hypermail 2.3.1 : Monday, 23 October 2017 14:53:40 UTC