[sugar] Studly caps

Marco Pesenti Gritti mpg
Fri Jul 21 20:35:30 EDT 2006


Robert McQueen wrote:
> Marco Pesenti Gritti wrote:
>   
>> Hi,
>>
>> the presence service is now using studly caps in package names and in
>> signal names. We should really have a convention about this...
>>     
>
> The convention on D-Bus is to use StudlyCaps (including Single words)
> for methods, signals, interfaces names and object paths (except for the
> parts which are derived from domain components). It's usually mapped by
> the bindings to the convention of your local language, so in Glib:
>  BarSignal -> BAR_SIGNAL (the constant) / bar-signal (the string)
>  FooInterface.BazMethod -> foo_interface_baz_method
>
> The point of this is that provided the D-Bus interfaces have a
> consistent capitalisation, it's easy to map to the conventions of other
> languages. If you try and put eg glib conventions into your D-Bus API,
> it will come out as very ugly in other language bindings, so I'd
> recommend against it.
>
>   
>> I don't have such a strong feeling about the specific convention... but
>> we should really make our conventions clear and use them consistently.
>>     
>
> In D-Bus, use the D-Bus conventions, which will map to the glib
> conventions in those bindings, and the correct conventions elsewhere.
>
>   

D-Bus convention for the presence D-Bus service and glib conventions for 
the tiny gobject based wrapper sounds like a sensible approach to me.

Marco



More information about the Sugar-devel mailing list