Describe best practices for property names, and recommend against dash-separated-words

Related to <https://bugs.freedesktop.org/show_bug.cgi?id=20948> whose
conclusion seemed to be that anything is allowed, but CamelCase is
considerably more interoperable.
This commit is contained in:
Simon McVittie 2011-05-17 17:10:36 +01:00
parent f0f67e4329
commit 1909039b19

View file

@ -3066,6 +3066,22 @@
out DICT&lt;STRING,VARIANT&gt; props);
</programlisting>
</para>
<para>
It is conventional to give D-Bus properties names consisting of
capitalized words without punctuation ("CamelCase"), like
<link linkend="message-protocol-names-member">member names</link>.
For instance, the GObject property
<literal>connection-status</literal> or the Qt property
<literal>connectionStatus</literal> could be represented on D-Bus
as <literal>ConnectionStatus</literal>.
</para>
<para>
Strictly speaking, D-Bus property names are not required to follow
the same naming restrictions as member names, but D-Bus property
names that would not be valid member names (in particular,
GObject-style dash-separated property names) can cause interoperability
problems and should be avoided.
</para>
<para>
The available properties and whether they are writable can be determined
by calling <literal>org.freedesktop.DBus.Introspectable.Introspect</literal>,