Class Diagram Editor

The Subsystems in the lowest level of the Subsystem hierarchy are composed of any number of Classes. The Class Diagram Editor enables you to model the Classes of a Subsystem and show the static relationships between them. The following types of relationship are possible in the Class Diagram: Inheritance (Generalization), Aggregation and Association.

In order to illustrate the access to the Classes, a differentiation is made between Export, Internal and Import Classes. Classes defined as internal should not be imported. The same class may be referenced in more than one Subsystem. References to Classes of other Subsystems are shown by Import Classes. In fact, referencing the same Class in multiple Subsystems is the mechanism for binding Subsystems together. There should be fewer links between Subsystems (external binding) than within the Subsystems (internal binding). The Attributes and Operations of each Class are shown in its Class symbol. You can reduce the number of visible Attributes and Operations in order to keep the diagram clear.

Aggregation versus Association

Classes can be bound together by two forms of relationship that do not involve inheritance: aggregation and association. Aggregation is a special form of Association. If two Classes are bound together by a part-whole relationship, it is an aggregation. If the two objects are usually considered as independent, even though they may often be linked, it is an Association. For example, a company is an aggregation of its divisions, which in turn are an aggregation of departments. A company is not an aggregation of its employees because company and person are independent objects of equal stature. You can either create an Aggregation between two Classes or you can change an Association into an Aggregation using the Alter command on the relationship.

Aggregation versus Generalization

Aggregation is not the same thing as Generalization. Aggregation relates to instances: two distinct objects are involved and one object is part of the other. Generalization relates to classes and is a way of structuring the description of a single object. Both base class (or superclass) and derived class (or subclass) refer to properties of a single object.

Aggregation can be regard as an „and relationship" and generalization as an „or relationship". A lamp is made of a base and a cover and a switch, and so on. A lamp is a fluorescent lamp or an incandescent lamp, and so on.

Generalization

The term generalization refers to the relationship among Classes; the term inheritance refers to the mechanism of obtaining attributes and operations using the generalization structure. Generalization provides the means for refining a base class into one or more derived classes. The base class contains features common to all classes; the derived classes contain features specific to each class. A derived class may override a base class feature by defining a feature with the same name. The overriding feature (the derived class feature) refines and replaces the overridden feature (the base class feature). A derived class may override default values of attributes and methods of operations. An override should preserve attribute type, number, and type of arguments to an operation and operation return type. Inheritance may occur across an arbitrary number of levels where each level represents one aspect of a Class. A Class accumulates features from each level of a generalization hierarchy.

Layers

The Class Diagrams can be viewed from different perspectives with the help of „views" or layers. The definition of these views gives you great freedom when drawing the diagrams. You can ensure that even a complex diagram remains clear by simply reducing the number of elements visible. This means that you do not have to create multiple Class Diagrams just to illustrate different perspectives or views. To assign a layer to an object, select the object and then choose Layer from the popup menu. Using the Layer command from the View menu you can choose which layers to display in the diagram.

Pull-down Menus
The following pull-down menus are available in the Class Diagram Editor:

File

Edit

View

Draw

Options

Popup Menus
There are also popup menus available within the Class Diagram Editor. These are activated by pressing the right mouse button. A different menu appears depending on the pointer position. There is a different menu when you are:

pointing to an Export Class

pointing to an Internal Class

pointing to an Import Class

pointing to an Association

pointing to an Aggregation

pointing to a Generalization

pointing to Text

pointing within a selection frame

not pointing to any component of the diagram.

In the last situation, ProMod-PLUS assumes that you want to create a Class or Text.

Double-click on graphical objects

If you double-click on a graphical object this carries out the most commonly used command. The command started is different if you double-click on the label of an object or on the symbol excluding the label. For example, if you double-click on the name of an Export Class this carries out Alter on the Class name. If you double-click on the Export Class symbol outside the Class name this carries out Association.

The following table shows the full list of commands carried out when double-clicking on objects.

Symbol

Label

Export Class Association Alter
Internal Class Association Alter
Import Class Association Alter
Association Alter Alter
Aggregation Alter Alter
Generalization Alter ---
Text --- Alter