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.

168 Modelling <strong>of</strong> Concurrent <strong>Reactive</strong> Behaviour<br />

6.3.6.2 Message with Reply Flow Symbol<br />

The message with reply flow symbol represents a synchronous message passing with reply,<br />

which is a two way communication. The flow symbol has two arrowheads (see Figure<br />

6.5). The end with the arrow heads is at the receiving object. The backwards directed<br />

second arrowhead represents the reply. This flow symbol simplifies the Message Flow<br />

Diagrams because it replaces the two single message flows that would be necessary<br />

otherwise. The semantics <strong>of</strong> the symbol are restricted to synchronous communication with<br />

reply and waiting. The message name is denoted on the flow. This message name can be<br />

followed by a list <strong>of</strong> parameters, and a list <strong>of</strong> possible answers (message names) which<br />

is preceded by a slash symbol. The parameters are data objects which are denoted by<br />

their class names. Figure 6.5 shows that a message with message-name serviceOffered can<br />

serviceOffered(ServiceName)/<br />

process A process B<br />

required,notRequired<br />

Figure 6.5: A Message with Reply Flow<br />

be sent. The message contains a data-object <strong>of</strong> class ServiceName. The sender expects<br />

one <strong>of</strong> the two possible answers which is either the message required or the message<br />

notRequired.<br />

The message with reply flow symbol is very convenient to describe a client-server model.<br />

We need only one flow to connect the client to the server and we can specify the request<br />

together with the accompanying information and the possible answers.<br />

Notice that there is a difference with the description <strong>of</strong> communication with data objects.<br />

There we use a message-send expression, and do not have a channel. The sort <strong>of</strong><br />

communication seems to be similar: synchronous communication with waiting and<br />

reply. However there is a very fundamental difference. A message to a data object<br />

is tightly coupled with the activation <strong>of</strong> the corresponding behaviour <strong>of</strong> the object<br />

(correspondence between message-name and method in the data object). Recall that<br />

process objects have a conceptual separation between the readiness to receive a message<br />

and the possible activation <strong>of</strong> a method. By doing so the receiver is not forced any more<br />

to give an immediate answer. The message with reply flow symbol specifies waiting. So<br />

although this is a powerful primitive for analysis, the consequence is that we must be<br />

careful when writing the corresponding behaviour.<br />

The POOSL behaviour description <strong>of</strong> the message with reply flow needs two messagesend<br />

and message-receive statement pairs. The designer must be aware <strong>of</strong> the fact that<br />

he is responsible for the explicit specification <strong>of</strong> the waiting <strong>of</strong> the sender (= client).This<br />

can easily be realised. The message receive statement for the reply must be the first

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

Saved successfully!

Ooh no, something went wrong!