[NoInterfaceObject]

The current draft of the W3C Contacts API annotates every interface with [NoInterfaceObject].

http://dev.w3.org/2009/dap/contacts/

I tried to discuss this with the working group, but they feel that its important to not pollute the global name space.

I think this is wrong and breaks established DOM bindings patterns, so I would propose some language to be added to WebIDL to narrowly define in what cases [NoInterfaceObject] should be used.

In some of the use cases in the W3C Contacts API dictionaries can be used (the working group is already receptive to this idea).

For general APIs we should disallow [NoInterfaceObject]. The Contacts API for example defines this:

[NoInterfaceObject]
interface ContactError {
 const unsigned short UNKNOWN_ERROR = 0;
 ...
}
This seems really counter-intuitive. Developers will want to use this by name (ContactError.UNKNOWN_ERROR). Instead of arguing with each working group about their particular view of what good DOM bindings look like, we should add some guidance in WebIDL.
TC39 is already tackling global name space pollution using modules.
If there is no actual forward-looking use left for [NoInterfaceObject] maybe we can remove it altogether.
Andreas

Received on Monday, 29 August 2011 20:26:36 UTC