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.3 Classes 65<br />

Class B<br />

Attributes<br />

Messages<br />

Class A<br />

Attributes<br />

Messages<br />

Class C<br />

Attributes<br />

Messages<br />

Superclass<br />

Specialisation<br />

symbol<br />

Subclass<br />

Figure 4.4: Generalisation/Specialisation Relation<br />

Relations are represented as connections between the class symbols. A triangle symbol<br />

represents a generalisation/specialisation relation. (There are various other forms <strong>of</strong><br />

relations and corresponding symbols for Object Class Models. These are described in<br />

Section 4.13). Figure 4.4 can be interpreted as showing the superclass-subclass relation<br />

between classes. The superclass contains the messages and attributes that are necessary<br />

for its instances. The subclass adds additional attributes and messages. An instance <strong>of</strong> a<br />

subclass contains these attributes and messages, but contains also the common attributes<br />

and messages defined in the superclass. After all, a subclass has at least the properties<br />

that its superclass has.<br />

4.3.4 Inheritance<br />

Object Class Diagrams give a static, so-called conceptual view on a problem domain. Figure<br />

4.4 shows a static hierarchical structure <strong>of</strong> classes. This hierarchy can be interpreted<br />

using a parent-child metaphor. Super and subclass have similarities and differences<br />

like parent and child. The parent- child metaphor can be extended with the notion <strong>of</strong><br />

inheritance. A child inherits properties <strong>of</strong> its parents. Correspondingly, a subclass can<br />

inherit properties, such as attributes, <strong>of</strong> its superclass. Other terms that are used to refer<br />

to generalisation <strong>of</strong> classes across multiple levels are: ancestor (parent) and descendant<br />

(child). The hierarchical structure may have several levels, and form an inheritance tree.<br />

The leafs <strong>of</strong> the tree inherit from all their ancestors.<br />

4.3.4.1 <strong>Specification</strong> Inheritance<br />

The concept <strong>of</strong> inheritance is considered as a very important property <strong>of</strong> object-oriented<br />

methods and languages. This concept can be used to specify common properties only<br />

once, which is the foundation for reuse. Generalisation/specialisation relations visualised<br />

in Object Class Diagrams are a communication tool among people for the structuring<br />

<strong>of</strong> the problem domain. We <strong>of</strong>fer reuse in the form <strong>of</strong> inheritance in a specific way,

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

Saved successfully!

Ooh no, something went wrong!