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.

4.15 Operations, Services, Methods 111<br />

whether they are examined or not. This helps to achieve completeness. Moreira differentiates<br />

in ROOA [Mor94] between Offered Services and Required Services. An <strong>of</strong>fered<br />

service is defined as a capability that an object exports and which can be used (called) by<br />

other objects in the model. A required service is a service required from another object<br />

[Mor94].<br />

4.15.3 Methods<br />

We define a method as a POOSL behaviour description <strong>of</strong> one or more operations. Methods<br />

are specified for object classes. They give an algorithm in the form <strong>of</strong> POOSL<br />

statements. Notice that POOSL behaviour descriptions are still specifications in the<br />

sense that this behaviour must finally be implemented in s<strong>of</strong>tware or hardware. This<br />

definition is different from traditional ones, where methods are the actual implementation<br />

<strong>of</strong> an operation in a class. The concept <strong>of</strong> method has completely different meanings<br />

for data objects and process objects. This is described in the following paragraph.<br />

4.15.3.1 Data Object Methods<br />

The operations that can be performed by a data object correspond one to one to the<br />

methods defined in its class. Operation and service is the same concept for a data object.<br />

The names <strong>of</strong> the methods are the names <strong>of</strong> the messages that the object is responding<br />

to. A method may need data that must come with the message to perform the required<br />

operation. This data is transferred with the message in the form <strong>of</strong> a collection <strong>of</strong><br />

parameters. A method <strong>of</strong> a data class is user defined or primitive:<br />

m(u1 : C1 ¥¡ ¡ ¡ ¥ un : Cn) : C ¡ v1 : C¡1 ¡ ¡ vm : C¡m ¡ E<br />

¡ m(u1 : C1 ¥¡ ¡ ¡ ¥ un : Cn) : C primitive<br />

A reception <strong>of</strong> a message with name m leads to the evaluation <strong>of</strong> expression E, and the<br />

returning <strong>of</strong> the result to the sender <strong>of</strong> the message. The result is an object <strong>of</strong> class C.<br />

The behaviour <strong>of</strong> some methods cannot be expressed as expressions. So-called primitive<br />

methods are specified in the form <strong>of</strong> axioms in the semantics <strong>of</strong> the language (See Chapter<br />

8). Besides the parameters u1 ¥¡ ¡ ¡ ¥ un that should come with the message, a method may<br />

have local variables v1 ¥¡ ¡ ¡ ¥ vm to store intermediate results during the operation. Each<br />

variable is assigned a type in the form <strong>of</strong> a name <strong>of</strong> a data class. Variable u1, for instance,<br />

will refer to an object <strong>of</strong> class C1.<br />

4.15.3.2 Process Object Methods<br />

Whereas data object methods follow object-oriented traditions, the methods <strong>of</strong> process<br />

objects differ strongly. There is no direct relation between message names and methods.<br />

The message interface <strong>of</strong> a class is defined by:<br />

message interface l1 ¡ ¡ lm<br />

in which each li is either <strong>of</strong> the form ch!m ¢<br />

¥¡ ¡ ¡ ¥ C1 £ Cn or <strong>of</strong> the form ch?m ¢<br />

¥¡ ¡ ¡ ¥ Cn£ C1 . This<br />

denotes that message m can be sent respectively be received with n data objects <strong>of</strong> classes

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

Saved successfully!

Ooh no, something went wrong!