Re: Property names vs. interface names

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