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

Re: Hanging the APIs off navigator.device

From: Doug Turner <w3c@dougt.org>
Date: Tue, 15 Dec 2009 07:27:28 -0800
Cc: <public-device-apis@w3.org>
Message-Id: <D2F5A738-CC45-45F1-B9BC-522E0B0DAF3F@dougt.org>
To: <richard.tibbett@orange-ftgroup.com> <richard.tibbett@orange-ftgroup.com>
Another option is to simply hang the device specific object directly off of navigator.

navigator.contacts.create(...)
navigator.contacts.find(...)


Requiring ".device." is just extra stuff to type and doesn't provide any important encapsulation.  This also would be consistent with the geolocation api:

navigator.geolocation.

System Info & Events could be something like:

navigator.systemInfo.get(...)

Doug Turner

On Dec 15, 2009, at 1:58 AM, <richard.tibbett@orange-ftgroup.com> <richard.tibbett@orange-ftgroup.com> wrote:

> Hi,
> 
> Just wondering whether we should settle on a specific approach to
> hanging certain APIs off the navigator.device object.
> 
> At the moment I spy three different approaches:
> 
> In Contacts [1]: 
> 
> navigator.device.contacts.create(...)
> navigator.device.contacts.find(...)
> 
> In File Writer [2]:
> 
> navigator.device.textWriter(...)
> navigator.device.fileWriter(...)
> 
> In System Info & Events [3]:
> 
> navigator.device.get(...)
> navigator.device.watch(...)
> navigator.device.set(...)
> 
> 
> So just wondering whether we should take a unified approach to this
> stuff. I'd prefer [1] but, well, I'm biased as editor. Maybe [2] works
> well (with [1] becoming navigator.device.createContact and
> navigator.device.findContacts)?
> 
> What do people think?
> 
> Kind Regards,
> 
> Richard
> 
> 
> [1] http://dev.w3.org/2009/dap/contacts/
> 
> [2] http://dev.w3.org/2009/dap/file-system/file-writer.html
> 
> [3] http://dev.w3.org/2009/dap/system-info/
> 
> 
Received on Tuesday, 15 December 2009 15:28:07 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Wednesday, 9 May 2012 00:14:03 GMT