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

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

From: Robin Berjon <robin@robineko.com>
Date: Mon, 30 Nov 2009 18:26:47 +0100
Cc: "richard.tibbett" <richard.tibbett@orange-ftgroup.com>, public-device-apis <public-device-apis@w3.org>
Message-Id: <40AF932E-9DC8-4E84-9CE4-C0A7D93285EB@robineko.com>
To: Dominique Hazael-Massieux <dom@w3.org>
Hi Dom,

On Nov 30, 2009, at 11:21 , Dominique Hazael-Massieux wrote:
> ē all the interfaces defined in the API are annotated with
> [NoInterfaceObject] [2] ; I think itís may make sense for the Contacts
> interface depending on the mechanism used to secure the access to the
> addressbooks, itís probably not appropriate for many of the other
> interfaces; for instance, I donít see how one would add a contact right
> now, since one cannot instantiate the Contact interface; was there a
> rationale for hiding the interface object? Maybe some of the interfaces
> can/should remain hidden through convenience functions, but theyíre not
> defined in the API right now

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.

Robin Berjon
  robineko ó hired gun, higher standards
Received on Monday, 30 November 2009 17:27:16 UTC

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