Re: Property names vs. interface names

What about Property pCPU vs. interface iCPU?

Mohamed


On Mon, May 10, 2010 at 3:38 PM, Max Froumentin <maxfro@opera.com> 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?
>
> Property PropCPU vs. interface CPU?
> Property CPU vs. interface IntCPU?
> Property PropCPU vs. interface IntCPU?
> ...
>
> Max.
>
>
>
>>>>>> 2) Can it be said explicitely that the name of the Property (the
>>>>>> property ID) is the same as the name of the Interface that the
>>>>>> onSuccess function will get
>>>>>
>>>>> No, it's not always true. For instance, property AmbientLight (and all
>>>>> the
>>>>> other sensors) are based on interface Sensor.
>>>>
>>>> Uhm...indeed. Ok but there is certainly room for clarification here.
>>>> Dunno how for the moment.
>>>
>>> Perhaps it would be better to call interfaces and property something
>>> explicitely different? Like CPUInterface and CPU, respectively (or with
>>> better names)?
>>
>> That seems to be a good direction. Probably, you should implement it
>> that way (XXX and XXXInterface) and let the people come up with better
>> naming strategy
>



-- 
Innovimax SARL
Consulting, Training & XML Development
9, impasse des Orteaux
75020 Paris
Tel : +33 9 52 475787
Fax : +33 1 4356 1746
http://www.innovimax.fr
RCS Paris 488.018.631
SARL au capital de 10.000 €

Received on Monday, 10 May 2010 13:41:45 UTC