ISSUE-44 (apiHanging): What do APIs hang off of? [APIs ??? General]

ISSUE-44 (apiHanging): What do APIs hang off of? [APIs — General]

Raised by: Robin Berjon
On product: APIs — General

one issue we have with APIs is also how they are exposed. Say for  
instance that the Contacts API has a basic interface providing access  
to the rest of the functionality called "Contacts". We could:

1) Make it available as a constructor:
2) Make it available as an object already instantiated in the global  
3) Make a way of requesting that an API be "loaded"
4) Use an object to provide access to all the device APIs
5) Hang it off from a markup element
6) Hang it off from an event object

Discussion thread starting at:
which lead to the following observations:
• window.navigator has been used many times for this type of APIs
• a possible window.navigator.device host for the DAP APIs, with the start of a spec at
• the need to look at on an API-per-API basis, taking into account the security model, the activation model (e.g. from an event, a markup element), the locking model wrt Web workers
• the need to watch for clashes in existing Web content
(the latter two points having been raised by Hixie

Received on Thursday, 12 November 2009 08:02:09 UTC