Class

StarUML

Class

Top  Previous  Next

Semantics

A class is the descriptor for a set of objects with similar structure, behavior, and relationships.

Procedure for creating class

In order to create class,

1.Click [Toolbox] -> [Class] -> [Class] button.

ch05_2019

2.And click at the position where class will be placed in the [main window].

ch05_2020

3.A new class is created on the diagram and class quick dialog is opened.
4.At the quick dialog, enter the class name and press [Enter] key.

ch05_2031

Procedure for adding attribute

There are three method to add attribute to class.

·using quick dialog
·using model in the [main window] or the [model explorer]
·using [collection editor]

In the case of using quick dialog,

1.Double-click class.
2.Press [Add Attribute] button at the quick dialog, and you can add attribute.

ch05_2032 ch05_2033

In the case of using model,

1.Select class in the [main window] or in the [model explorer].
2.Right-click the selected class, select [Add] -> [Attribute] popup menu, and you can do.

ch05_2034

In the last case,

1.Select [Collection Editor...] popup menu.

ch05_2035

2.Or click ch05_2036 button in [attributes] property on properties window.

ch05_2037

3.At [attribute] tab of the [collection editor], you can add attribute by using ch05_2201 button.

ch05_2038

Procedure for adding operation

There are three method to add attribute to class.

·using quick dialog
·using model in the [main window] or the [model explorer]
·using [collection editor]

In the case of using quick dialog,

1.Double-click class and class quick dialog is shown.
2.Press [Add Operation] button at the quick dialog, and you can add operation.

ch05_2039

In the case of using model, select class in the [main window] or in the [model explorer], right-click the selected class, select [Add] -> [Operation] popup menu, and you can do.

ch05_2040

In the last case,

1.Select [Collection Editor...] popup menu.

ch05_2041

2.At [operations] tab of the [collection editor], you can add operation by using ch05_2042 button.

ch05_2043

Procedure for adding parameter to operation

In order to add parameter to operation,

1.Select operation in the [model explorer], select [Add] -> [Parameter] popup menu, and new parameter will be added.

ch05_2044

2.Or select operation in the [model explorer], select [Collection Editor...] popup menu.

ch05_2045

3.Or click ch05_2046 button in [Parameters] property on properties window.

ch05_2047

4.At the [Parameters] tab of the [collection editor], you can add parameter by using ch05_2048 button.

ch05_2049

Procedure for adding exception to operation:

Before this procedure, there must exist a exception or more. To do this, see "Procedure for creating signal" or "Procedure for creating exception".

1.Click ch05_2093 button in [RaisedSignals] property on properties window.

ch05_2050

2.At [Raised Signals] tab of the [collection editor], you can add exception to the operation by using ch05_2051 button.

ch05_2052

3.At [Select a Signal] dialog, select signal or exception raised by operation and click [OK] button.

ch05_2053

4.The result is as follows.

ch05_2054

Procedure for moving attribute/operation into other class

In order to move attribute or operation into the other class,

1.Click a attribute(or operation).

ch05_2055

2.Drag it.

ch05_2056

3.Drop it into another class.

ch05_2057

Procedure for adding template parameter to class

There are two way to add template parameter to class

·using class model in the [main window] or the [model explorer]
·using [collection editor]

Select class in the [main window] or the [model explorer], right-click, and select [Add] -> [TemplateParameter] popup menu. Then you can add template to class.

ch05_2058

Select [Collection Editor...] popup menu or click ch05_2059 button in [TemplateParameter] property on properties window. At the [TemplateParameters] tab of the [collection editor], you can add template parameter to class by using ch05_2060 button.

ch05_2061

A new template parameter is added to class. The result is as follows.

ch05_2062

Procedure for creating view by dragging port

You can create port by dragging port from [model explorer] to main diagram.

1.Drag port in the [model explorer].

ch05_2065

2.Drop on the class in the main diagram. If it is not dropped on the class but on the other area of the diagram, Class with port will be created.

ch05_2066

3.The class has a port as follows.

ch05_2067

Procedure for setting active class

In order to set class to active class,

1.Set class's [IsActive] property to true.

ch05_2400

2.The result class is shown as follows.

ch05_2073