W3C home > Mailing lists > Public > public-device-apis@w3.org > May 2010

Re: Property names vs. interface names

From: Max Froumentin <maxfro@opera.com>
Date: Tue, 18 May 2010 10:21:26 +0200
Message-ID: <4BF24E06.6020708@opera.com>
To: Robin Berjon <robin@robineko.com>
CC: public-device-apis@w3.org, Innovimax SARL <innovimax@gmail.com>
On 17/05/2010 09:25, Robin Berjon wrote:
> On May 10, 2010, at 15:38 , Max Froumentin wrote:
>> So let me ask at large, and summarise the issue. SysInfo deals with
>> Properties (CPU, PowerSource, InputDevice) which are named in
>> function calls, e.g. get("CPU", callback). The callback then
>> receive an object that represent that property, defined by an
>> interface, e,g, interface CPU { float load }
>>
>> Using the same name for the property and its interface is confusing
>> (for reasons explained in this thread). So what's a good way of
>> naming them?
>
> I am not convinced that it's confusing :) Most (in fact all I guess)
> the interfaces defined in this specification are not intended to be
> exposed to authors (or did I miss something?). Authors ought to only
> see the property name. The type name might show up in debugging, but
> I don't think that that'll be confusing.

True.

> This leaves open the possibility that it will be confusing to
> implementers. I'm not certain that that's such a big risk, is it?

No, but it's not a big effort to have different names for different 
things, either. It's just a matter of finding those names (which 
admittedly is something working groups can spend a lot of time on).
Right now I have settled for *Attributes for type names. For instance, 
CPUAttributes for the CPU property or SensorAttributes for the sensor 
properties (AmbientLight, AmbientAtmosphericPressure and the like).

Max.
Received on Tuesday, 18 May 2010 08:22:35 UTC

This archive was generated by hypermail 2.3.1 : Monday, 23 October 2017 14:53:43 UTC