Re: Hanging the APIs off navigator.device

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 UTC