Hanging stuff of navigator

There seems to be a trend in some WG's to hang stuff off the Navigator object (namely DAP, SysApps). This seems to have started with Geolocation.  

Wouldn't it be better if, for given functionality, the API be provided through the interface object [1]? In case some of you don't know what an interface object is, it's those objects that sit on the window object that start with a capital letter (except the ones provided by JS, but for the purpose of this discussion they can all be considered interface objects):  

window.Node
window.HTMLHtmlElement
window.Whatever…  

Interface objects currently sit mostly unused on the window object not doing anything particularly helpful (except the occasional "x instanceof Y").  

For example, to send a message through the SysApps Messaging API, you currently have to do this:

navigator.messaging.sms.send ('+1234567890', 'How are you?'))

Wouldn't it be better to instead hang this off the interface object? like this:  

Messaging.send("sms", '+1234567890', 'How are you?');  

Thoughts? Is continuing to hang stuff of navigator a good thing for developers and the platform? Should we start encouraging working groups to make better use of interface objects through static functions?  

[1] http://dev.w3.org/2006/webapi/WebIDL/#interface-object

--  
Marcos Caceres

Received on Thursday, 16 May 2013 13:01:09 UTC