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.

396 Case Study<br />

data class<br />

PI<br />

instance variables<br />

idNumber : Integer<br />

destination : Destination<br />

requiredServicesSet:<br />

RequiredServicesSet<br />

This part <strong>of</strong> the class description directly follows from the Object Class Diagram <strong>of</strong><br />

Figure 12.9. The instance variable idNumber implements the idNumber attribute. The<br />

aggregation relation <strong>of</strong> arity ’zero or one’ with the Destination class is implemented<br />

by the destination variable. Finally, the aggregation relation <strong>of</strong> arity ’zero or more’ is<br />

implemented by a RequiredServicesSet <strong>of</strong> required services.<br />

Next to the attributes <strong>of</strong> class PI, the Object Class Diagram <strong>of</strong> Figure 12.9 also describes<br />

the messages. Since PI is a data class, these messages correspond to the methods in a<br />

one-to-one fashion. The methods are specified as follows:<br />

instance methods<br />

requires(service:Service):Boolean<br />

requiredServicesSet containsMatchOf(service)<br />

markPending(service:Service):PI<br />

requiredServicesSet selectMatchOf(service) markPending;<br />

self<br />

markPerformed(service:Service):PI<br />

requiredServicesSet selectMatchOf(service) markPerformed;<br />

self<br />

Upon invocation <strong>of</strong> the first (accessor) method, it is evaluated whether the collection requiredServicesSet<br />

contains a RequiredService that matches the value <strong>of</strong> parameter service 19 .<br />

The result <strong>of</strong> the evaluation is the result <strong>of</strong> the method invocation. In the second and the<br />

third (transformer) methods, the RequiredService matching the value <strong>of</strong> parameter service<br />

is marked ’pending’ respectively marked ’performed’.<br />

The second data class that will be described is Position. The first part <strong>of</strong> this class is given<br />

by:<br />

data class<br />

Position<br />

instance variables<br />

positionNumber : Integer<br />

19 The actual evaluation is carried out by the instance <strong>of</strong> class RequiredServicesSet. This class is not further<br />

elaborated.

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

Saved successfully!

Ooh no, something went wrong!