23.08.2013 Views

Specification of Reactive Hardware/Software Systems - Electronic ...

Specification of Reactive Hardware/Software Systems - Electronic ...

Specification of Reactive Hardware/Software Systems - Electronic ...

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

6.3 Communication 167<br />

can be described as transitions from state to state. The conditions that decide whether<br />

a transition takes place or not, can <strong>of</strong>ten be modelled as events. In Section 6.4, about<br />

dynamic behaviour, we describe how we model events and states. The happening <strong>of</strong> an<br />

event can be communicated with a single message flow symbol.<br />

Another useful notion is command. Some messages can be interpreted as commands. In<br />

general, such messages do not have to carry data. There is not much difference with<br />

an event in this case. A command denotes the notion <strong>of</strong> an order, a control assignment,<br />

or a decree to the receiver <strong>of</strong> the message. The sender does not expect an answer, but<br />

simply expects the receiver to perform the requested operation(s). A command may<br />

stop or initiate behaviour <strong>of</strong> the receiver. A command may be extended with data.<br />

Data can specify which operation(s) must be performed. Data can also be given to be<br />

operated upon. Recall that the sending object does not expect a result, so it can continue<br />

its operations immediately. This is powerful when we want to describe concurrent<br />

behaviour.<br />

Synchronous message passing without reply may be performed by an object that does<br />

expect a reply. The term without reply is based on the fact that the sender does not suspend<br />

its activities during the waiting for a reply. We need two separate communications when<br />

we want to model the true concurrent form <strong>of</strong> synchronous communication with reply<br />

but without waiting. So we need two flows in opposite direction to model this. The use<br />

<strong>of</strong> two flows clearly indicates the relative independence <strong>of</strong> both communications. Both<br />

sender and receiver continue their operations until they change roles for the transmission<br />

<strong>of</strong> the reply on the initial request.<br />

Notice that the text on the flows is very important for the interpretation <strong>of</strong> the flow. We<br />

give some guidelines here. A name containing the word give can indicate that a reply<br />

must follow. Commands can be indicated by using the imperative mood, for example<br />

doSomeAction, calculateSum or moveHandle. Events should express that something<br />

happened, for example temperatureExceeded.<br />

Summary<br />

The single message flow symbol is useful for modelling <strong>of</strong>:<br />

a message with or without data, that does not request a reply;<br />

events;<br />

commands;<br />

a message that requests a separate communication for the reply. This form enables<br />

concurrent behaviour <strong>of</strong> sender and receiver between the rendezvous.<br />

Guidelines for the naming <strong>of</strong> the flows can improve the clearness <strong>of</strong> the model.<br />

The POOSL description consists <strong>of</strong> a message-send and a message-receive statement<br />

pair.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!