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

4.4.2.5 Equality and Equivalence<br />

The equality operation, denoted as ==, is a predefined operation in POOSL, that can be<br />

used in any object class. The operation == determines whether two objects refer to the<br />

same object. We explain the meaning with an example, which also shows some aspects<br />

<strong>of</strong> data object communication and behaviour expression evaluation. The following<br />

supervisor<br />

X<br />

scheduler<br />

feedServer<br />

A<br />

cardInjector<br />

C<br />

Figure 4.8: Data Object References<br />

expression checks whether objects A and C in Figure 4.8 refer both to the same object B.<br />

supervisor whatIsYourFeedServer ¡ scheduler whatIsYourCardInjector<br />

This expression is part <strong>of</strong> the behaviour description <strong>of</strong> object X. The evaluation <strong>of</strong> the<br />

expression causes a sequence <strong>of</strong> actions. The first part <strong>of</strong> the expression must be read<br />

as: send to supervisor the message whatIsYourFeedServer. Object X has a reference to A,<br />

stored in variable supervisor. So object X sends the message named whatIsYourFeedServer<br />

to object A. Object A receives message whatIsYourFeedServer. Object A performs an<br />

operation that corresponds to the reception <strong>of</strong> this message and returns the result to<br />

object X. This result is object B. So this communication causes that object X gets (a<br />

temporary reference to) object B. This reference has not been shown in Figure 4.8. The<br />

expression is partially evaluated now to:<br />

B ¡ scheduler whatIsYourCardInjector<br />

This means that message == scheduler whatIsYourCardInjector must be sent to object B.<br />

The message name is == and the parameter sent with the message is scheduler whatIsYour-<br />

CardInjector. The message == can be sent because X has a reference to B. The parameter<br />

scheduler whatIsYourCardInjector has to be evaluated before the sending. This part <strong>of</strong> the<br />

expression must be read as: send to object scheduler the message whatIsYourCardInjector.<br />

This message is sent to the object that is stored in variable scheduler. This object is object<br />

B

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

Saved successfully!

Ooh no, something went wrong!