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

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

4.4 Data Objects and Process Objects 69<br />

The behaviour <strong>of</strong> the objects in a Data Class is specified in a Class definition. A class<br />

definition is a formal behaviour description in the form <strong>of</strong> a POOSL Data Class. Many<br />

properties <strong>of</strong> data classes in POOSL are equal to that <strong>of</strong> classes in Smalltalk [GR89]. They<br />

have instance variables, local variables, and methods. Instance variables implement<br />

attributes found during analysis into the formal class definition. Methods describe an<br />

object’s responses to the reception <strong>of</strong> messages. POOSL is an imperative language. So,<br />

the behaviour specification is ’implemented’ in POOSL in the form <strong>of</strong> statements.<br />

Data object A<br />

4.4.2.2 Sequential Behaviour<br />

message<br />

reply<br />

Figure 4.6: Data Objects<br />

Data object B<br />

Data objects model passive entities. They must receive a message to become active.<br />

Data objects that exchange messages perform together a sequential behaviour. Only one<br />

object is actively performing operations at the same time. When the sender <strong>of</strong> a message<br />

is another data object this sender becomes passive. Figure 4.6 illustrates data object 1<br />

communication. To be able to send a message, data object A must be activated by the<br />

reception <strong>of</strong> a message which has not been shown. A becomes passive after sending<br />

a message to B. Subsequently B becomes active, and processes the message. After<br />

returning a reply B becomes passive again, and A becomes active.<br />

4.4.2.3 References<br />

A data object can communicate with another data object when it ’knows’ that object’s<br />

name. The latter object is said to be an acquaintance <strong>of</strong> the first object. An object ’knows’<br />

its acquaintances by having references to it. References to objects can be passed between<br />

objects. In this way objects can extend or limit their collection <strong>of</strong> acquaintances. This<br />

enables very flexible communication. References are stored in instance variables. Figure<br />

4.7 shows three objects. Both object A and object C know object B. Both have a reference<br />

to object B. Object A has a reference to object B, which is stored in variable feedServer.<br />

Object C has such a reference in variable cardInjector.<br />

References are encapsulated in the objects and cannot be addressed directly by other<br />

1 The circle symbol is for illustration purposes only. It has no formal status in the method.

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

Saved successfully!

Ooh no, something went wrong!