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

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
  http://robineko.com/

Received on Monday, 30 November 2009 17:27:16 UTC