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

Hi Richard,

On Dec 3, 2009, at 16:51 , <> wrote:
> So, in order to not pollute the global namespace, could we keep the
> Constructor pattern but constrain this to our device namespace?
> Something like this:
> var newContact = new navigator.device.contacts.Contact('Pink Unicorn');
> ...rather than reverting to this...
> var newContact = navigator.contacts.add({name: {formatted: 'Pink
> Unicorn'}});

There's another option :)

var newContact = navigator.device.createContact('Orange Unicorn');

and then proceed as you would have with the constructor. It's not a big difference, but not all users are used to the fact that constructors don't have to be in the global namespace.

Robin Berjon
  robineko  hired gun, higher standards

Received on Thursday, 3 December 2009 17:41:53 UTC