Class Diagram (UML)

Class Diagram is a static structure diagram which describes the structure of a system by showing its classes with their attributes and operations, and the relationships among objects.

Software Ideas Modeler offers tools for following elements of a class diagram:

  • Package
  • Class
  • Interface
  • Enumeration
  • Structure
  • Table
  • Signal
  • Collaboration
  • Usage
  • Association
  • Unidirectional Association
  • Bidirectional Association
  • N-ary Association
  • Composition
  • Aggregation
  • Generalization
  • Realization
  • Dependency
  • Containment
  • Interface

Class

A class is an extensible template for creating objects, it is a common form for all instances of the same type (e.g. concept, thing, person). Each class can contain:

  • Attributes
  • Operations
  • Template parameters
  • Stereotypes
  • Tagged values
  • Documentation

Visibility

Visibility determines the scope, in which can be attributes and operations seen and manipulated by other objects. UML defines these symbols for visibility of members (attributes or operations)

Symbol Visibility Meaning
+ Public Defines a member which is accessible from the whole project.
~ Package Defines a member which is accessible from the whole package.
# Protected Defines a member which is accessible from the class and its subclasses.
- Private Defines a member which is accessible only from the class, where it is specified.

Attribute

Attribute is a named data field within a classifier, which determines allowed data using its type, multiplicity a constraints. Each class can have zero or more attributes. Attributes are defined within an attribute compartment (placed after name compartment) of a classifier.

Attribute format: <<stereotypes>> visibility_symbol name : type [multiplicity ordering] = default_value {constraint}

Abstract attributes are indicated by italic.

Static attributes are indicated by underline.

Software Ideas Modeler offers several ways how to add, edit and delete attributes of a class:

  • using menu Element / Add / Attribute
  • using context bar button Add Attribute
  • using Properties dialog
  • using Fast editor

Each attribute is defined by:

  • Name
  • ID
  • Type
  • Visibility
  • Default Value
  • Multiplicity
  • Ordering
  • Constraint
  • Modifiers
  • Stereotypes
  • Documentation
  • Tagged Values

Operation

Operation is a method, fuction or query, which can be called by other objects. Each operation has its name and it can have any number of parameters (zero or more). Each operation should perform only one thing. Operations are defined within a operation compartment (placed after attribute compartment) of a classifier.

Operation format: <<stereotypes>> visibility_symbol name (parameter1 ... parameterN) : return_type

Abstract operations are indicated by italic.

Static operations are indicated by underline.

Software Ideas Modeler offers several ways how to add, edit and delete operations of a class:

  • using menu Element / Add / Operation
  • using context bar button Add Operation
  • using Properties dialog

Each operation is defined by:

  • Name
  • ID
  • Return type
  • Visibility
  • Modifiers
  • Stereotypes
  • Parameters
  • Body
  • Documentation
  • Tagged Values

Operation Parameter

Operation Parameter is usualy an input argument, although it may be also an output or input-output argument.

Operation format: direction name : type [multiplicity]

Each operation parameter can be defined using:

  • Name
  • Type
  • Direction - it can be input (in), output (out), input-output (inout) or return
  • Default value
  • Multiplicity
  • Documentation
  • Tagged values

Association

Aggregation

Aggregation is a kind of the "has a" association relationship. It is an association that represents a part-whole or part-of relationship. Diamond arrow points from a part to a whole.

Aggregation Example

Composition

Composition is a stronger kind of the "has a" association relationship. It is similar to the aggregation, but it is more specific. Existence of a part (connected with composition) is dependent on the whole.

Composition Example

Generalization

Generalization specifies relationship between a super class and its subclass. Arrow points from a sub class to a super class. Super class represents a base for subclasses.

GeneralizationExample

Realization

Realization specifies relationship between an interface and a class, which implements this interface. Arrow points from a class to an interface.

RealizationExample

Dependency

Depedency specifies relationship between two dependent classes. Arrow points to the class, which is used by the second class.

Dependency Example

Containment

Containment specifies relelationship between a parent class and a nested inner class.

Containment Example

Package

It is a general purpose container element for grouping of elements, which represent a logical, semantical or another unit. A package can be contained in other packages. Each package defines its namespace.

Interface

It is an abstract element that defines operations which must be implemented in a classifier. A classifier is connected to implemented interfaces using realization relationships.

Enumeration

It is a user-defined type, which consists of enumerated literals/named values.

Comments

KC 24 March 2016 23:39:36

Attributes of attributes

I am trying to figure out how to set the attributes of the attributes such as foreign-key, primary-key,auto-increment. How do you set them in the app?

Dusan Rodina - softwareideas.net 25 March 2016 2:12:50

RE: Attributes of attributes

The best way is to choose Entity Relationship Diagram (Project/Add Diagram/Other/Entity Relationship Diagram). Insert an entity to your diagram, add an attribute, right-click on it and choose Primary Key, Foreign Key, Nullable or Auto Increment from context menu.

If you want to use UML Class Diagram, you can add an attribute with custom stereotypes to a class. You can create custom stereotypes for foreign key and auto increment (right click on attribute / Field Properties / Stereotypes tab). You can use (UML) standard modifier 'ID' for primary key (right click on attribute / Field Properties / Modifiers group)

Bruno Santos 30 October 2017 17:46:29

Association multiplicity

I can't select the association multiplicity in the Class diagrams, it opens and closes very fast in the upper left corner. It looks like a bug. Can somebody help me?

Dusan Rodina - softwareideas.net 30 October 2017 18:40:51

RE: Association multiplicity

This problem may occur at some zoom levels. It will be fixed in the next release this week.

New Comment

Comment