Channels ▼


OMG's Data Distribution Service Standard

The DDS Programming Model

Figure 3 illustrates the key objects in typical DDS distributed application. A "domain" is an abstract concept referring to a collection of DomainParticipant objects that can communicate with each other. A "DomainParticipant" object represents the membership of an application in a domain. Thus, a domain represents a communication plane: participants may communicate only with other participants on the same domain. The DomainParticipant is a container of all other DDS objects.

Figure 3: Object diagram of a typical DDS application. The domain comprises of three DomainParticipants communicating over three different Topics. The first DomainParticipant contains a Subsriber constaining a single DataReader and a Publisher containing two DataWriters. The second DomainParticipant contains a single subscriber containing two DataWriter bound to two different topics. The third DomainParticipant contains a single Publisher containing a single DataWriter.

A "Publisher" object is responsible for data issuance, and may publish data of different data types. A "DataWriter" object is a typed facade to a publisher; participants use DataWriter(s) to communicate the value of and changes to data of a given type. Once new data values have been communicated to the publisher, it is the Publisher's responsibility to determine when it is appropriate to issue the corresponding message and to actually perform the issuance (the Publisher will do this according to its QoS, or the QoS attached to the corresponding DataWriter, and/or its internal state).

A "Subscriber" object receives published data and makes it available to the participant. A Subscriber may receive and dispatch data of different specified types. To access the received data, the participant must use a typed "DataReader" attached to the Subscriber.

The association of a DataWriter object (representing a publication) with DataReader objects (representing the subscriptions) is done by means of the "Topic". A Topic associates a name (unique in the system), a data type, and QoS related to the data itself. The type definition provides enough information for the service to manipulate the data (for example serialize it into a network-format for transmission). The definition can be done by means of a textual language (e.g. something like "float x; float y;") or by means of an operational "plugin" that provides the necessary methods.

Figure 4 shows the DDS class diagram. A DomainParticipantFactory is a singleton used to create and delete DomainParticipants. A DomainParticipants is bound to the domain given by DomainParticipant::get_domain_id(). The DomainParticipant acts as factory for creating and deleting the DomainEntities Topic, Publisher, and Subscriber. The Publisher acts as a factory for creating and deleting strongly types DataWriters for a previously created topic. The Subscriber acts as a factory for creating and deleting strongly types DataReaders for a previously created topic. The DataWriter::write() operation allows the user application to update the data with anew value. The DataReader::take() operation is used to take the received data sample from the DDS middleware.

[Click image to view at full size]
Figure 4: UML class diagram showing the DDS entity inheritance and containment relationships. Key methods are shown.

The abstract Entity interface defines the common operations supported by all the DomainParticipant, and the DomainEntities (i.e. Topic, Publisher, DataWriter, Subscriber, DataReader). The get_qos() and set_qos() operation can be used to retrieve and modify of the QoS; the get_listener() and operations can be used to retrieve and install user listeners for specific status conditions that can be detected by the DDS middleware. The exact list of QoS policies and listeners is specific to each concrete entity type.

Related Reading

More Insights

Currently we allow the following HTML tags in comments:

Single tags

These tags can be used alone and don't need an ending tag.

<br> Defines a single line break

<hr> Defines a horizontal line

Matching tags

These require an ending tag - e.g. <i>italic text</i>

<a> Defines an anchor

<b> Defines bold text

<big> Defines big text

<blockquote> Defines a long quotation

<caption> Defines a table caption

<cite> Defines a citation

<code> Defines computer code text

<em> Defines emphasized text

<fieldset> Defines a border around elements in a form

<h1> This is heading 1

<h2> This is heading 2

<h3> This is heading 3

<h4> This is heading 4

<h5> This is heading 5

<h6> This is heading 6

<i> Defines italic text

<p> Defines a paragraph

<pre> Defines preformatted text

<q> Defines a short quotation

<samp> Defines sample computer code text

<small> Defines small text

<span> Defines a section in a document

<s> Defines strikethrough text

<strike> Defines strikethrough text

<strong> Defines strong text

<sub> Defines subscripted text

<sup> Defines superscripted text

<u> Defines underlined text

Dr. Dobb's encourages readers to engage in spirited, healthy debate, including taking us to task. However, Dr. Dobb's moderates all comments posted to our site, and reserves the right to modify or remove any content that it determines to be derogatory, offensive, inflammatory, vulgar, irrelevant/off-topic, racist or obvious marketing or spam. Dr. Dobb's further reserves the right to disable the profile of any commenter participating in said activities.

Disqus Tips To upload an avatar photo, first complete your Disqus profile. | View the list of supported HTML tags you can use to style comments. | Please read our commenting policy.