]> git.ipfire.org Git - thirdparty/dbus.git/commitdiff
Describe best practices for property names, and recommend against dash-separated...
authorSimon McVittie <simon.mcvittie@collabora.co.uk>
Tue, 17 May 2011 16:10:36 +0000 (17:10 +0100)
committerSimon McVittie <simon.mcvittie@collabora.co.uk>
Tue, 17 May 2011 16:10:36 +0000 (17:10 +0100)
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.

doc/dbus-specification.xml

index 86e2b9b7f570cab193a4cdedcb0a1ab4df8a80bc..88360af56a71827646ce69ed5368bb9337ba42f6 100644 (file)
                                                       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>,