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.

108 Abstraction <strong>of</strong> a Problem Domain<br />

the data (attributes) are determined by the need to exchange data via communication<br />

flows. The natural need for new objects to be defined, comes from the need to contract<br />

out operations. An accompanying need to transport and store data determines additional<br />

attributes. The classes containing these objects are specified after playing various<br />

scenarios <strong>of</strong> behaviour in Message Flow Diagrams. Therefore, depending on the sort<br />

<strong>of</strong> communication that is used, links to objects can yield attributes in a natural way.<br />

When the Object Class Modelling approach is used at least a part <strong>of</strong> the relationships<br />

must also be implemented this way. It will be clear that both modelling approaches<br />

have advantages and disadvantages. The instance approach is quite implementation<br />

and construction-oriented, and leads to quick results. The Object Modelling approach<br />

is useful for a conceptual approach, and is more appropriate to define the real world<br />

problem domain. This definition is however time consuming. There are uncountable<br />

possibilities to combine various decisions to refine relations into attributes, objects or<br />

operations. Only mature judgement will lead to a balanced result, that redeems some<br />

<strong>of</strong> the promises <strong>of</strong> object-orientation, such as reusability.<br />

4.14.2 Variables<br />

Attributes become variables in the formal behaviour description <strong>of</strong> the object classes in<br />

POOSL. The abstraction level where POOSL descriptions are created is lower than the<br />

abstraction level <strong>of</strong> Object Modelling. Variables model the attributes specified during<br />

conceptual modelling, but they also support lower level needs such as local data and<br />

identifiers <strong>of</strong> acquaintances.<br />

There are various ways to define sorts <strong>of</strong> variables for various purposes. For instance,<br />

Smalltalk <strong>of</strong>fers private variables in the form <strong>of</strong> Instance variables and Temporary variables.<br />

Besides that there are variables that can be accessed by more that one object: Class<br />

variables, Global variables, and Pool variables [GR89]. The latter three types are all used<br />

for sharing variables among objects. They are shared respectively by instances <strong>of</strong> a single<br />

class, by instances <strong>of</strong> all classes, and by instances <strong>of</strong> a set <strong>of</strong> classes. The Smalltalk<br />

language is untyped. This is in contrast to Eiffel [Mey88] which is a second example<br />

<strong>of</strong> an object-oriented language. Eiffel is a statically typed language. Every attribute <strong>of</strong><br />

a class is declared with a unique type. Private local variables are used by routines to<br />

perform their computations. Eiffel does not support any form <strong>of</strong> shared variables. These<br />

two examples <strong>of</strong> languages show already that there is a world <strong>of</strong> alternative concepts in<br />

the design <strong>of</strong> methods and languages.<br />

Currently, POOSL is an untyped language, just as Smalltalk is. POOSL <strong>of</strong>fers instance<br />

variables and temporary (local) variables, but no form <strong>of</strong> shared variables. To enable<br />

adequate static checking <strong>of</strong> specifications, POOSL will become a statically typed language<br />

(see also Subsection 4.3.4). To achieve this, we will have to define a formal type<br />

system. Such a system is not formally developed yet. For the time being, however, we<br />

will assume that each variable is assigned a type. This type is specified by indicating<br />

the class <strong>of</strong> the instances to which the variable is allowed to refer.

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

Saved successfully!

Ooh no, something went wrong!