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.

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

Object<br />

Class A<br />

Object<br />

Type<br />

Object<br />

Class B<br />

Object Object<br />

Figure 4.3: Relation Type - Class<br />

The counterpart <strong>of</strong> generalisation is specialisation. Among entities <strong>of</strong> the same type,<br />

some may have additional capabilities or properties. These specialised entities are<br />

subtypes <strong>of</strong> the original type. The original type is a generalisation <strong>of</strong> the subtypes and is<br />

called a supertype. Subtype entities have at least the properties and capabilities that its<br />

supertype entities have.<br />

4.3.3 Generalisation/Specialisation<br />

4.3.3.1 The Role <strong>of</strong> Generalisation/Specialisation<br />

Generalisation and specialisation are useful concepts for analysis and design <strong>of</strong> classes.<br />

Object-oriented methods use generalisation/specialisation relations between classes<br />

as a means to provide reuse via so-called inheritance. We interpret generalisation/specialisation<br />

relations as a means to discover types and subtypes <strong>of</strong> objects so<br />

that they can be classified. Generalisation/specialisation relations appear to have a<br />

fundamentally different interpretation in most other methods: the interpretation <strong>of</strong><br />

generalisation/specialisation is <strong>of</strong>ten directed to code reuse. This interpretation is not<br />

consistent with the type interpretation.<br />

4.3.3.2 Generalisation/Specialisation Relations<br />

Corresponding to supertypes and subtypes <strong>of</strong> entities, classes can be defined as superclasses<br />

and subclasses. A superclass is a generalisation <strong>of</strong> a collection <strong>of</strong> classes. In the<br />

other direction a (super)class can be specialised (refined) into subclasses. Specialisation<br />

implies that a subclass has an is a or is a kind <strong>of</strong> relation with its superclass. An object<br />

from a subclass is also an object from its superclass. This means that the subclass entities<br />

have at least the properties that the superclass entities have. Hence, a subclass<br />

is said to have an ’is a’ relation with its superclass. Figure 4.4 shows how such a generalisation/specialisation<br />

(is a) relation can be visualised in an Object Class Diagram.

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

Saved successfully!

Ooh no, something went wrong!