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

Re: [WebIDL] add text to discourage `[Optional] Interface / [NoInterfaceObject] interface Interface` and encourage `dictionary Dictionary` instead

From: Cameron McCormack <cam@mcc.id.au>
Date: Thu, 01 Sep 2011 17:12:31 +1200
Message-ID: <4E5F143F.30103@mcc.id.au>
To: Allen Wirfs-Brock <allen@wirfs-brock.com>
CC: timeless <timeless@gmail.com>, public-script-coord@w3.org
On 31/08/11 3:50 AM, Allen Wirfs-Brock wrote:
> That sounds like it would discourage patterns like this:
>
> [NoInterfaceObject]
> interface SomeOpaqueType {};
>
> interface SomeResourceManager {
> SomeOpaqueType getSomeResource(...);
> void operateUsingResource(in SomeOpaqueType);
> }
>
>
> I don't see why you would want to discourage this as it is a well
> understood design pattern. For example see,
> http://web.cecs.pdx.edu/~antoy/flp/patterns/#Opaque%20Type
> <http://web.cecs.pdx.edu/~antoy/flp/patterns/#Opaque Type>

My question here would be why make SomeOpaqueType [NoInterfaceObject]? 
The original interface would need to be [Callback] also, so that JS 
objects could be considered "user objects" of that interface, so the 
above would be safe from timeless' wording.

I think anyway that the guidance in the spec should be worded more along 
the lines of:

   When writing an API that uses an ECMAScript object as a "property
   bag" like function argument, specification authors are recommended
   to use IDL dictionaries to handle these rather than a
   [Callback,NoInterfaceObject] interface with attributes defined on it.
Received on Thursday, 1 September 2011 05:16:21 UTC

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