- From: Robin Berjon <robin@robineko.com>
- Date: Thu, 3 Dec 2009 18:41:17 +0100
- To: <richard.tibbett@orange-ftgroup.com>
- Cc: <dom@w3.org>, <public-device-apis@w3.org>
Hi Richard, On Dec 3, 2009, at 16:51 , <richard.tibbett@orange-ftgroup.com> 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 http://robineko.com/
Received on Thursday, 3 December 2009 17:41:53 UTC