User Tools

Site Tools


coding:uml:syntax

Class diagrams

Class

A class has a name, fields and operations

A class is NOT an object, objects are instances of classes

Each field or method has a visibility: public, protected, private or package internal

PlantUML Graph

Association

Expresses: Class A has a relationship with Class B

An association might be directed and/or have a multiplicity/cardinality

PlantUML Graph

Aggregation

Expresses: “The whole “comprises” the parts”, “The parts “belong to” the whole”

Destroying the “whole” does not destroy the parts

The parts may be shared with other classes

PlantUML Graph

Composition

Expresses: “The whole “has”/“contains” the parts”, “The parts “are member of” the whole”

The parts are destroyed along with the “whole”

PlantUML Graph

A composition is an aggregation with a lifetime constraint.

Note about association/aggregation/composition

An aggregation and a composition are both more specific cases of an association

A composition is a strong relationship of the parts to the whole, if the parts can live without the whole, use an aggregation

Inheritance

Class inheritance

Expresses: “The derived class “is a” base class”

The base class generalizes/abstracts the derived classes

Derived classes specialize/extend the base class

PlantUML Graph

Interface inheritance

Expresses: “The derived class “behaves like” the interface”

The interface is a specification/contract/behaviour for the class

The classe implements the behaviour of the interface

PlantUML Graph

Use case diagrams

Actor

Actually a role taken on by some actor

PlantUML Graph

Use case

Actions accessible to specific actors

PlantUML Graph

Example

The rules for associations are similar to the ones of class diagrams

PlantUML Graph

coding/uml/syntax.txt · Last modified: 2015/12/22 12:54 by jaap.dehaan