next up previous contents
Next: Finite State Machine Up: Notations Previous: Notations

Subsections

Object Oriented Model

  The notation used for the object-oriented models has been taken from [Boo94]. Figure A.1 shows the symbols of the Booch Notation used in this thesis.


     
Abbildung A.1: Notation for object-oriented models

Classes are indicated using bubbles (Figure A.1(a)). A name is required for each class. If the class icon should include attributes or operations they will be separated from the class name by a line.

The relations between classes will be indicated using association arcs (Figure A.1(b)). The following association types exist:

Association
This type of arc indicates that two classes have a semantic connection to each other. Associations are often labeled using nouns.
Inheritance
This type of arc indicates the inheritance relationship between two classes. Inheritance means that the subclass inherits all the methods and attributes defined by its superclass. The arrowhead of the arc points to the superclass.
Has
This type of arc indicates a part of relationship. The end with the circle appears next to the class containing the other class.
Using
This type of arc indicates a client/supplier relationship. The end with the circle appears next to the client class.

The properties icons (Figure A.1(c)) indicate special types of classes or associations.

The abstract property may be present within a class's diagram indicating an abstract class. Abstract classes cannot be instantiated. Abstract classes define only the interface for some of their methods. The implementation of those methods has to be supplied by a subclass. This is useful for the exploitation of polymorphism (see [Boo94] for a detailed discussion).

The other properties shown in figure A.1(c) indicate special types of associations.

Friendship
The friendship property may be applied to the supplier of a relation, denoting that the supplier has granted extended access to the client.
Static
An association marked as static points to an instance that is owned by the class and not by its individual members.
Virtual
Indicates that a class's attributes and methods should be inherited once only. This is necessary, when a class is inherited twice through the use of multiple inheritance.

Example

The friend property will not be shown in this example. An explanation along with examples can be found in [Boo94].


  
Abbildung A.2: Example for object-oriented notation
\begin{figure}
 \begin{center}
 \leavevmode
 
\epsfig {file=eps/ex_oo.eps}
 \end{center}\end{figure}

Figure A.2 shows a class hierarchy for different transport vehicles. The base of all transport classes is the abstract class Transport. Thus, Transport declares only the methods that have to be implemented by its subclasses. This is indicated using the abstract property.

To count the number of transport vehicles instantiated the transport classes use a class variable for the counter. Whenever a transport class gets instantiated the counter is incremented and whenever a transport class is destroyed the counter is decremented. Hence all transport classes operate on the same Counter class. This is indicated by the static property.

The Car, Ship, and Amphibious Car classes inherit all methods and variables declared and defined by their base class. Since the Car and Ship classes are derived from the Transport class virtually, the Amphibious Car class inherits the methods and variables defined by Transport once only. Without virtual inheritance the Transport class would be allocated twice for the Amphibious Car class and hence the Counter class would be increased twice for Amphibious Car instances which is undesired in this situation.


next up previous contents
Next: Finite State Machine Up: Notations Previous: Notations
gschwind@infosys.tuwien.ac.at