Working with Class Diagrams¶
To create a Class Diagram:
- First select an element where a new Class Diagram to be contained as a child.
- Select Model | Add Diagram | Class Diagram in the Menu Bar or select Add Diagram | Class Diagram in Context Menu.
In Class Diagram, you can use following elements.
- Class
- Attribute
- Operation
- Parameter
- Template Parameter
- Interface
- Association
- Aggregation
- Composition
- Dependency
- Generalization
- Interface Realization
- Signal
- DataType
- PrimitiveType
- Enumeration
- AssociationClass
- Package
- Model
- Subsystem
- Containment
See also
- UML Class Diagram
- For more information about UML Class Diagram.
Class¶
To create a Class:
- Select Class in Toolbox.
- Drag on the diagram as the size of Class.
To create a Class (model element only) by Menu:
- Select an Element where a new Class to be contained.
- Select Model | Add | Class in Menu Bar or Add | Class in Context Menu.
To edit a Class, you can do following actions:
- Use Quick Edit for Classifier by double-click or press
Enter
on a selected Class. - Add Attribute - See Attribute.
- Add Operation - See Operation.
- Add Template Parameter - See Template Parameter.
To suppress Attributes, see Suppress Attributes.
To suppress Operations, see Suppress Operations.
To hide Operation signatures, see Show Operation Signature.
Attribute¶
To add an Attribute:
- Select a Classifier.
- Select Model | Add | Attribute in Menu Bar or Add | Attribute in Context Menu.
To edit an Attribute, you can do following actions:
- Use Quick Edit for Attribute by double-click or press
Enter
on a selected Attribute.
Operation¶
To add an Operation:
- Select a Classifier.
- Select Model | Add | Operation in Menu Bar or Add | Operation in Context Menu.
To edit an Operation, you can do following actions:
- Use Quick Edit for Operation by double-click or press
Enter
on a selected Operation. - Add Parameter - See Parameter.
To hide Operation signatures, see Show Operation Signature.
Parameter¶
To add a Parameter:
- Select an Operation.
- Select Model | Add | Parameter in Menu Bar or Add | Parameter in Context Menu.
Template Parameter¶
To add a Template Parameter:
- Select an Element.
- Select Model | Add | Template Parameter in Menu Bar or Add | Template Parameter in Context Menu.
To edit an Template Parameter, you can do following actions:
- Use Quick Edit for Template Parameter by double-click or press
Enter
on a selected Template Parameter.
Interface¶
To create an Interface:
- Select Interface in Toolbox.
- Drag on the diagram as the size of Interface.
To create an Interface (model element only) by Menu:
- Select an Element where a new Interface to be contained.
- Select Model | Add | Interface in Menu Bar or Add | Interface in Context Menu.
To edit an Interface, you can do following actions:
- Use Quick Edit for Classifier by double-click or press
Enter
on a selected Interface. - Add Attribute - See Attribute
- Add Operation - See Operation
- Add Template Parameter - See Template Parameter
To show an Interface as Lollipop notation, Interface should be realized (See Interface Realization) and then change Stereotype Display to Icon or Icon with Label (See Stereotype Display).
To show an Interface as Socket notation, Interface should have dependants (See Dependency) and then change Stereotype Display to Icon or Icon with Label (See Stereotype Display).
To suppress Attributes, see Suppress Attributes.
To suppress Operations, see Suppress Operations.
To hide Operation signatures, see Show Operation Signature.
Generalization¶
To create a Generalization:
- Select Generalization in Toolbox.
- Drag from an element (to be special) and drop on another element (to be general).
Association¶
To create an Association (or Directed Association):
- Select Association (or Directed Association) in Toolbox.
- Drag from an element and drop on another element.
Aggregation¶
To create an Aggregation:
- Select Aggregation in Toolbox.
- Drag from an element (to be a part) and drop on another element (to be whole).
Note
Aggregation is an association whose aggregation
propery is shared
.
Composition¶
To create a Composition:
- Select Composition in Toolbox.
- Drag from an element (to be a part) and drop on another element (to be whole).
Note
Composition is an association whose aggregation
propery is composite
.
Dependency¶
To create an Dependency:
- Select Dependency in Toolbox.
- Drag from an element (client) and drop on another element (supplier).
Interface Realization¶
To create an Interface Realization:
- Select Interface Realization in Toolbox.
- Drag from an element (realizing) and drop on an interface (to be realized).
Signal¶
To create a Signal:
- Select Signal in Toolbox.
- Drag on the diagram as the size of Signal.
To create a Signal (model element only) by Menu:
- Select an Element where a new Signal to be contained.
- Select Model | Add | Signal in Menu Bar or Add | Signal in Context Menu.
To edit a Signal, you can do following actions:
- Use Quick Edit for Classifier by double-click or press
Enter
on a selected Signal. - Add Attribute - See Attribute
- Add Operation - See Operation
- Add Template Parameter - See Template Parameter
DataType¶
To create a DataType:
- Select DataType in Toolbox.
- Drag on the diagram as the size of DataType.
To create a DataType (model element only) by Menu:
- Select an Element where a new DataType to be contained.
- Select Model | Add | DataType in Menu Bar or Add | DataType in Context Menu.
To edit a DataType, you can do following actions:
- Use Quick Edit for Classifier by double-click or press
Enter
on a selected DataType. - Add Attribute - See Attribute
- Add Operation - See Operation
- Add Template Parameter - See Template Parameter
PrimitiveType¶
To create a PrimitiveType:
- Select PrimitiveType in Toolbox.
- Drag on the diagram as the size of PrimitiveType.
To create a PrimitiveType (model element only) by Menu:
- Select an Element where a new PrimitiveType to be contained.
- Select Model | Add | PrimitiveType in Menu Bar or Add | PrimitiveType in Context Menu.
To edit a PrimitiveType, you can do following actions:
- Use Quick Edit for Classifier by double-click or press
Enter
on a selected PrimitiveType. - Add Attribute - See Attribute
- Add Operation - See Operation
- Add Template Parameter - See Template Parameter
Enumeration¶
To create an Enumeration:
- Select Enumeration in Toolbox.
- Drag on the diagram as the size of Enumeration.
To create an Enumeration (model element only) by Menu:
- Select an Element where a new Enumeration to be contained.
- Select Model | Add | Enumeration in Menu Bar or Add | Enumeration in Context Menu.
To edit a Enumeration, you can do following actions:
- Use Quick Edit for Enumeration by double-click or press
Enter
on a selected Enumeration. - Add EnumerationLiteral - See Enumeration Literal
- Add Attribute - See Attribute
- Add Operation - See Operation
- Add Template Parameter - See Template Parameter
To suppress Literals, see Suppress Literals.
Enumeration Literal¶
To add an Enumeration Literal:
- Select a Classifier.
- Select Model | Add | Enumeration Literal in Menu Bar or Add | Enumeration Literal in Context Menu.
To edit an Enumeration Literal, you can do following actions:
- Use Quick Edit for Enumeration Literal by double-click or press
Enter
on a selected Enumeration Literal.
AssociationClass¶
To create an Association Class by linking two Classifiers:
- Select Association Class in Toolbox.
- Drag from an element and drop on another element.
- An Association and a Class connected to the association will be created.
To create an Association Class by linking Association and Class:
- Select Association Class in Toolbox.
- Drag from an Association (or Class) and drop on a Class (or Association).
- The Class will be connected to the Association.