Class Diagram

Create Class Diagram

To create a Class Diagram:

  1. First select an element where a new Class Diagram to be contained as a child.

  2. Select Model | Add Diagram | Class Diagram in the Menu Bar or select Add Diagram | Class Diagram in Context Menu.

See also

UML Class Diagram - For more information about UML Class Diagram.

Model Element

Model Element is an abstract element of all UML model elements.

You can use QuickEdit for Model Element by double-click or press Enter on a selected model element.

  • Name Expression : Edit name expression.

    Syntax of Name Expression

    expression ::= [ '<<' stereotype `>>` ] [ visibility ] name
    stereotype ::= (identifier)
    visibility ::= '+' | '#' | '-' | '~'
    name ::= (identifier)
  • Visibility : Change visibility property.

  • Add Note : Add a linked note.

  • Add Constraint : Add a constraint.

Classifier

Classifier is an abstract element of:

You can use QuickEdit for Classifier by double-click or press Enter on a selected classifier.

  • Name Expression : Edit name expression.

    Syntax of Name Expression

    expression ::= [ '<<' stereotype `>>` ] [ visibility ] name
    stereotype ::= (identifier)
    visibility ::= '+' | '#' | '-' | '~'
    name ::= (identifier)
  • Visibility : Change visibility property.

  • Add Note : Add a linked note.

  • Add Constraint : Add a constraint.

  • Add Attribute (Ctrl+Enter) : Add an attribute.

  • Add Operation (Ctrl+Shift+Enter) : Add an operation.

  • Add Reception : Add a reception.

Class

To create a Class:

  1. Select Class in Toolbox.

  2. Drag on the diagram as the size of Class.

To create a Class (model element only) by Menu:

  1. Select an Element where a new Class to be contained.

  2. Select Model | Add | Class in Menu Bar or Add | Class in Context Menu.

You can use QuickEdit for Class by double-click or press Enter on a selected Class.

  • Name Expression : Edit name expression.

    Syntax of Name Expression

    expression ::= [ '<<' stereotype `>>` ] [ visibility ] name
    stereotype ::= (identifier)
    visibility ::= '+' | '#' | '-' | '~'
    name ::= (identifier)
  • Visibility : Change visibility property.

  • Add Note : Add a linked note.

  • Add Constraint : Add a constraint.

  • Add Attribute (Ctrl+Enter) : Add an attribute.

  • Add Operation (Ctrl+Shift+Enter) : Add an operation.

  • Add Template Parameter : Add a template parameter.

  • Add Reception : Add a reception.

  • Add Sub-Class : Add a sub-class.

  • Add Super-Class : Add a super class.

  • Add Provided Interface : Add a provided interface.

  • Add Required Interface : Add a required interface.

  • Add Associated Class : Add an associated class.

  • Add Aggregated Class : Add an aggregated class.

  • Add Composited Class : Add a composited class.

  • Add Port : Add a port.

  • Add Part : Add a part.

To suppress Attributes, see Suppress Attributes.

To suppress Operations, see Suppress Operations.

To suppress Receptions, see Suppress Receptions.

To show or hide Operation Signatures, see Show Operation Signature.

Attribute

To add an Attribute:

  1. Select a Classifier.

  2. Select Model | Add | Attribute in Menu Bar or Add | Attribute in Context Menu.

You can use QuickEdit for Attribute by double-click or press Enter on a selected Attribute.

  • Attribute Expression : Edit Attribute expression.

    Syntax of Attribute Expression

    attribute ::= [ '<<' stereotype `>>` ] [ visibility ] name [':' type ] [ '[' multiplicity ']' ] [ '=' defaut-value ]
    stereotype ::= (identifier)
    visibility ::= '+' | '#' | '-' | '~'
    name ::= (identifier)
    type ::= (identifier)
    multiplicity ::= multiplicity-bound [ '..' multiplicity-bound ]
    multiplicity-bound ::= (number) | '*'
    default-value ::= (string)
  • Visibility : Change visibility property.

  • Add (Ctrl+Enter) : Add one more attribute in the below.

  • Delete (Ctrl+Delete) : Delete the attribute

  • Move Up (Ctrl+Up) : Move the attribute up.

  • Move Down (Ctrl+Down) : Move the attribute down.

Operation

To add an Operation:

  1. Select a Classifier.

  2. Select Model | Add | Operation in Menu Bar or Add | Operation in Context Menu.

You can use QuickEdit for Operation by double-click or press Enter on a selected Operation.

  • Operation Expression : Edit Operation expression.

    Syntax of Operation Expression

    operation ::= [ '<<' stereotype `>>` ] [ visibility ] name [ '(' parameter-list ')' ] [ ':' return-type ]
    stereotype ::= (identifier)
    visibility ::= '+' | '#' | '-' | '~'
    name ::= (identifier)
    parameter-list ::= parameter [ ',' parameter ]*
    parameter ::= (identifier)
    return-type ::= (identifier)
  • Visibility : Change visibility property.

  • Add (Ctrl+Enter) : Add one more operation in the below.

  • Delete (Ctrl+Delete) : Delete the operation

  • Move Up (Ctrl+Up) : Move the operation up.

  • Move Down (Ctrl+Down) : Move the operation down.

To add a Parameter, see Parameter.

To show or hide Operation Signatures, see Show Operation Signature.

Parameter

To add a Parameter:

  1. Select an Operation.

  2. Select Model | Add | Parameter in Menu Bar or Add | Parameter in Context Menu.

Template Parameter

To add a Template Parameter:

  1. Select an Element.

  2. Select Model | Add | Template Parameter in Menu Bar or Add | Template Parameter in Context Menu.

You can use QuickEdit for Template Parameter by double-click or press Enter on a selected Template Parameter.

  • Template Parameter Expression : Edit Template Parameter expression.

    Syntax of Template Parameter Expression

    template-parameter ::= [ '<<' stereotype `>>` ] [ visibility ] name [':' type ] [ '=' defaut-value ]
    stereotype ::= (identifier)
    visibility ::= '+' | '#' | '-' | '~'
    name ::= (identifier)
    type ::= (identifier)
    default-value ::= (string)
  • Visibility : Change visibility property.

  • Add (Ctrl+Enter) : Add one more template parameter in the below.

  • Delete (Ctrl+Delete) : Delete the template parameter.

  • Move Up (Ctrl+Up) : Move the template parameter up.

  • Move Down (Ctrl+Down) : Move the template parameter down.

Template Parameter Substitution

To add a Template Parameter Substituion:

  1. Select a Template Binding element.

  2. Select Model | Add | Template Parameter Substitution in Menu Bar or Add | Template Parameter Substitution in Context Menu.

Each Template Parameter Substitution should have formal property assigned to a Template Parameter of the template element and actual property assigned to the actual value for the template parameter.

Interface

To create an Interface:

  1. Select Interface in Toolbox.

  2. Drag on the diagram as the size of Interface.

To create an Interface (model element only) by Menu:

  1. Select an Element where a new Interface to be contained.

  2. Select Model | Add | Interface in Menu Bar or Add | Interface in Context Menu.

You can use QuickEdit for Interface by double-click or press Enter on a selected Interface.

  • Name Expression : Edit name expression.

    Syntax of Name Expression

    expression ::= [ '<<' stereotype `>>` ] [ visibility ] name
    stereotype ::= (identifier)
    visibility ::= '+' | '#' | '-' | '~'
    name ::= (identifier)
  • Visibility : Change visibility property.

  • Add Note : Add a linked note.

  • Add Constraint : Add a constraint.

  • Add Attribute (Ctrl+Enter) : Add an attribute.

  • Add Operation (Ctrl+Shift+Enter) : Add an operation.

  • Add Reception : Add a reception.

  • Add Sub-Interface : Add a sub-interface.

  • Add Super-Interface : Add a super interface.

  • Add Realizing Class : Add an realizing class.

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 suppress Receptions, see Suppress Receptions.

To show or hide Operation Signatures, see Show Operation Signature.

Signal

To create a Signal:

  1. Select Signal in Toolbox.

  2. Drag on the diagram as the size of Signal.

To create a Signal (model element only) by Menu:

  1. Select an Element where a new Signal to be contained.

  2. Select Model | Add | Signal in Menu Bar or Add | Signal in Context Menu.

You can use QuickEdit for Classifier (See Classifier).

DataType

To create a DataType:

  1. Select DataType in Toolbox.

  2. Drag on the diagram as the size of DataType.

To create a DataType (model element only) by Menu:

  1. Select an Element where a new DataType to be contained.

  2. Select Model | Add | DataType in Menu Bar or Add | DataType in Context Menu.

You can use QuickEdit for Classifier (See Classifier).

PrimitiveType

To create a PrimitiveType:

  1. Select PrimitiveType in Toolbox.

  2. Drag on the diagram as the size of PrimitiveType.

To create a PrimitiveType (model element only) by Menu:

  1. Select an Element where a new PrimitiveType to be contained.

  2. Select Model | Add | PrimitiveType in Menu Bar or Add | PrimitiveType in Context Menu.

You can use QuickEdit for Classifier (See Classifier).

Enumeration

To create an Enumeration:

  1. Select Enumeration in Toolbox.

  2. Drag on the diagram as the size of Enumeration.

To create an Enumeration (model element only) by Menu:

  1. Select an Element where a new Enumeration to be contained.

  2. Select Model | Add | Enumeration in Menu Bar or Add | Enumeration in Context Menu.

You can use QuickEdit for Enumeration by double-click or press Enter on a selected Enumeration.

  • Name Expression : Edit name expression.

    Syntax of Name Expression

    expression ::= [ '<<' stereotype `>>` ] [ visibility ] name
    stereotype ::= (identifier)
    visibility ::= '+' | '#' | '-' | '~'
    name ::= (identifier)
  • Visibility : Change visibility property.

  • Add Note : Add a linked note.

  • Add Constraint : Add a constraint.

  • Add Literal (Ctrl+Enter) : Add an enumeration literal.

  • Add Operation (Ctrl+Shift+Enter) : Add an operation.

To suppress Literals, see see Suppress Literals.

Enumeration Literal

To add an Enumeration Literal:

  1. Select a Classifier.

  2. Select Model | Add | Enumeration Literal in Menu Bar or Add | Enumeration Literal in Context Menu.

You can use QuickEdit for Enumeration Literal by double-click or press Enter on a selected Enumeration Literal.

  • Name Expression : Edit name expression.

    Syntax of Name Expression

    expression ::= [ '<<' stereotype `>>` ] [ visibility ] name
    stereotype ::= (identifier)
    visibility ::= '+' | '#' | '-' | '~'
    name ::= (identifier)
  • Visibility : Change visibility property.

  • Add (Ctrl+Enter) : Add one more literal in the below.

  • Delete (Ctrl+Delete) : Delete the literal

  • Move Up (Ctrl+Up) : Move the literal up.

  • Move Down (Ctrl+Down) : Move the literal down.

Relationship

Relationship is an abstract element representing a relationship between UML elements.

Subclasses of Relationship are:

You can use QuickEdit by double-click or press Enter on a selected relationship.

  • Name Expression : Edit name expression.

    Syntax of Name Expression

    expression ::= [ '<<' stereotype `>>` ] [ visibility ] name
    stereotype ::= (identifier)
    visibility ::= '+' | '#' | '-' | '~'
    name ::= (identifier)
  • Visibility : Change visibility property.

  • Add Note : Add a linked note.

  • Add Constraint : Add a constraint.

Generalization

To create a Generalization:

  1. Select Generalization in Toolbox.

  2. Drag from an element (to be special) and drop on another element (to be general).

You can use QuickEdit for Relationship (See Relationship).

Association

To create an Association (or Directed Association):

  1. Select Association (or Directed Association) in Toolbox.

  2. Drag from an element and drop on another element.

You can use QuickEdit for Relationship (See Relationship).

You can also use QuickEdit for Association End by double-click at the end side of an Association.

  • Name Expression : Edit name expression.

    Syntax of Name Expression

    expression ::= [ '<<' stereotype `>>` ] [ visibility ] name
    stereotype ::= (identifier)
    visibility ::= '+' | '#' | '-' | '~'
    name ::= (identifier)
  • Visibility : Change visibility property.

  • Navigability : Change navigable property.

  • Aggregation Kind : Change aggregationKind property.

  • Multiplicity : Change multiplicity property.

  • Add Qualifier : Add a qualifier (attribute) to the AssociationEnd.

Order of Ends

You can show an arrow representing order of ends. If you want to show arrow from end1 to end2, then select forward in QuickEdit. Or, you want to show arrow from end2 to end1, then select backward. You can also hide the arrow by selecting hide.

You can set navigable property of AssociationEnd to one of following:

  • unspecified

  • navigable

  • notNavigable

N-ary Association

The N-ary association here is different from the UML specification and is not a semantically correct modeling method. Please refer to the UML specification for details.

If you want to create N-ary association, you need to create N-ary association node first.

To create an N-ary Association:

  1. Select N-ary Association Node in Toolbox (Class Advanced)

  2. Drag on the diagram as the size of N-ary Association Node (diamond shape).

  3. Create Associations between Classifiers and the N-ary Association Node.

Ownership

To show ownership dot on AssociationEnd, assign ownerAttribute of AssociationEnd.

Aggregation

To create an Aggregation:

  1. Select Aggregation in Toolbox.

  2. Drag from an element (to be a part) and drop on another element (to be whole).

You can use QuickEdit for Relationship (See Relationship).

You can also use QuickEdit for AssociationEnd by double-click at the end side of an Association (See Association).

Note

Aggregation is an association whose aggregation property is shared.

Composition

To create a Composition:

  1. Select Composition in Toolbox.

  2. Drag from an element (to be a part) and drop on another element (to be whole).

You can use QuickEdit for Relationship (See Relationship).

You can also use QuickEdit for AssociationEnd by double-click at the end side of an Association (See Association).

Note

Composition is an association whose aggregation property is composite.

Dependency

To create an Dependency:

  1. Select Dependency in Toolbox.

  2. Drag from an element (client) and drop on another element (supplier).

You can use QuickEdit for Relationship (See Relationship).

Interface Realization

To create an Interface Realization:

  1. Select Interface Realization in Toolbox.

  2. Drag from an element (realizing) and drop on an interface (to be realized).

You can use QuickEdit for Relationship (See Relationship).

Association Class

To create an Association Class by linking two Classifiers:

  1. Select Association Class in Toolbox.

  2. Drag from an element and drop on another element.

  3. An Association and a Class connected to the association will be created.

To create an Association Class by linking Association and Class:

  1. Select Association Class in Toolbox.

  2. Drag from an Association (or Class) and drop on a Class (or Association).

  3. The Class will be connected to the Association.

Template Binding

To create a Template Binding:

  1. Select Template Binding in Toolbox.

  2. Drag from a bound element and drop on a template element.

  3. If required, create Template Parameter Substitution.

You can use QuickEdit for Template Binding by double-click or press Enter.

  • Visibility : Change visibility property.

  • Add Note : Add a linked note.

  • Add Constraint : Add a constraint.

  • Add Template Parameter : Add a template parameter substitution.

Frame

To create a Frame view of a particular model element:

  1. Select Frame in Toolbox.

  2. Drag on the diagram as the size of Frame.

  3. Select a model element which the Frame represents in Element Picker Dialog

Tag

To add a Tag of an element:

  1. Select an element to add a Tag.

  2. Select Model | Add | Tag in Menu Bar or Add | Tag in Context Menu.

You can select one of tag kinds: string, reference, boolean, or number. The value property corresponds to string kind. The reference property corresponds to reference kind. The checked property corresponds to boolean kind. The number property corresponds to number kind.

The Tags can be shown in views by checking Format > Show Property menu item. If you don't want to be shown, check hidden property.

You can manage Tags conveniently in Tag Editor with relationships of Stereotype's Attributes.

Constraint

To add a Constraint of an element:

  1. Select an element to add a Constraint.

  2. Select Model | Add | Constraint in Menu Bar or Add | Constraint in Context Menu.

You can create a Constraint view on a diagram by drag and drop from Model Explorer.

Last updated