W3C home > Mailing lists > Public > public-script-coord@w3.org > July to September 2011

[NoInterfaceObject]

From: Andreas Gal <gal@mozilla.com>
Date: Mon, 29 Aug 2011 13:26:11 -0700
Message-Id: <5DAF279D-5204-4BE1-85F7-A11D216973B7@mozilla.com>
To: public-script-coord@w3.org

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

This archive was generated by hypermail 2.3.1 : Wednesday, 8 May 2013 19:30:04 UTC