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 161<br />

6.3.3.4 Messages, Encapsulation, Sharing and Distribution<br />

Encapsulation is a very important concept in the object-oriented paradigm. Encapsulation<br />

creates independence. Of course the communication mechanism must support this<br />

independence. Message passing does so. Data in an object cannot be accessed directly.<br />

Access is performed indirectly via a request in the form <strong>of</strong> a message.<br />

Analysis methods based on Statecharts [Har87], such as Statemate [H 90], Fusion [C 94]<br />

and OMT [R 91] have a form <strong>of</strong> communication based on broadcast and on the sharing<br />

<strong>of</strong> variables. This conflicts with the idea <strong>of</strong> encapsulation. Sharing is further unattractive<br />

when it must be implemented in a distributed system, where it can become very inefficient.<br />

Besides conventional message passing, the analysis methods described above<br />

have an additional form <strong>of</strong> communication. They allow an object to change state on a<br />

condition that depends on the states <strong>of</strong> other objects, without the use <strong>of</strong> explicit messages.<br />

We decided to stick to pure encapsulation. Only via messages it is possible to get<br />

information about the state <strong>of</strong> an object. So we have a uniform mechanism that is<br />

always the same, also in case <strong>of</strong> distribution.<br />

6.3.4 The Basic Primitive for Process Communication<br />

An analysis method must be able to express a variety <strong>of</strong> communication concepts with<br />

various notations and graphical symbols. This variety is meant to give an easy and<br />

intuitive understanding <strong>of</strong> a system. Further, there must be a straightforward way to<br />

formalise the various communication concepts in POOSL. Here again, the design <strong>of</strong> a<br />

method appears to be a struggle with selection problems and concept mapping problems.<br />

On the one side there is a wish to keep the method simple, easy to learn, to understand,<br />

and easy to formalise. So a minimum number <strong>of</strong> primitives is desirable. Conversely there<br />

is an inclination to add more and more constructs and symbols <strong>of</strong>fering expressive power<br />

for all kinds <strong>of</strong> communication. This subsection give reasons for the selection <strong>of</strong> the<br />

concept <strong>of</strong> one way message passing as the basis for process communication in POOSL.<br />

The following subsections describe how the various sorts <strong>of</strong> process communication can<br />

be expressed with this single primitive.<br />

One way synchronous message passing between two process objects is defined as an instantaneous<br />

simultaneous directed handing over <strong>of</strong> a message, where one object plays the<br />

role <strong>of</strong> sender and the other <strong>of</strong> receiver. Instantaneous means the message passing is<br />

considered to be happening in an infinitesimal period <strong>of</strong> time. Simultaneous means that<br />

both partners must be actively taking part in the communication at the same instant in<br />

time. This notion is <strong>of</strong>ten verbalised as rendezvous. The direction <strong>of</strong> the communication<br />

(one way) gives the partners a role. One is sender and the other is receiver. The communication<br />

is directed from sender to receiver, thereby defining the direction <strong>of</strong> the flow <strong>of</strong><br />

the message.<br />

The selection <strong>of</strong> a simple and adequate communication concept (primitive) has been<br />

a key issue in the design <strong>of</strong> the method. A first choice to be made is whether the

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

Saved successfully!

Ooh no, something went wrong!