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.

6.6 Dynamic Behaviour 211<br />

6.6.5 Modelling Behaviour <strong>of</strong> Data Objects<br />

Traditionally an object is a collection <strong>of</strong> operations that share a variables state. The<br />

operations determine the messages to which the object can respond. The variables<br />

state is hidden from the outside world and is accessible only to the object’s exported<br />

operations. Variables representing the internal variables state <strong>of</strong> the object are called<br />

instance variables and its operations are called methods. The collection <strong>of</strong> methods<br />

determines an object’s interface and its behaviour.<br />

Data objects (in contrast to process objects) follow a traditional object-oriented approach.<br />

A precise description <strong>of</strong> the syntax and semantics <strong>of</strong> data objects can be found in Chapter<br />

8. In this subsection we give an informal description <strong>of</strong> how dynamic behaviour <strong>of</strong> data<br />

objects is modelled.<br />

6.6.5.1 Data Class <strong>Specification</strong><br />

The behaviour <strong>of</strong> a data object is described in its class. A data class definition begins<br />

typically as:<br />

data class C<br />

instance variables x1 : C1 ¡ ¡ xn : Cn<br />

instance methods MD1 ¡ ¡ MDk<br />

The keyword data class announces the declaration <strong>of</strong> the class name denoted as C here.<br />

Next follows a declaration <strong>of</strong> the instance variables. They model the attributes. Each<br />

instance variable is assigned a type in the form <strong>of</strong> a data class. The instance methods<br />

specify the possible forms <strong>of</strong> behaviour. The instance method names define the message<br />

names that the object can respond to. In contrast to process objects there is no explicit<br />

description <strong>of</strong> the message interface.<br />

A method definition MD is <strong>of</strong> the form:<br />

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

or <strong>of</strong> the form:<br />

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

The behaviour <strong>of</strong> a method is normally described in a user defined data expression E. An<br />

alternative form <strong>of</strong> behaviour is a so-called primitive method which is not user defined.<br />

Primitive methods are pre-defined built-in methods.<br />

A method is specified with one or more parameters ¢<br />

the objects that are contained in a message that requires the execution <strong>of</strong> this method.<br />

Each parameter is assigned a type in the form <strong>of</strong> a data class.<br />

u1¥¡ ¡ ¡ ¥ un £ . The parameters represent<br />

Further there can be specified zero or more local variables ¡ v1¥¡ ¡ ¡ ¥ vn ¡ . They are for<br />

temporary storage <strong>of</strong> intermediate results <strong>of</strong> internal calculations. They do not represent

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

Saved successfully!

Ooh no, something went wrong!