Unified Modeling Language (UML) 2.x

Unified Modeling Language (UML) 2.x

© Franck Barbier

Modélisation, grands principes

« Modélisation orientée objet », une démarche intellectuelle…

UML langage de modélisation - fondements

UML langage de modélisation - usages

Méta-modèle versus modèle métier

Model Driven Software Development - principe

Model Driven Software Development - contexte

From Unified Method 0.8 to UML 2.x

“The Unified Modeling Language is a visual language for specifying, constructing and documenting the artifacts of systems. It is a general-purpose modeling language that can be used with all major object and component methods, and that can be applied to all application domains (e.g., health, finance, telecom, aerospace) and implementation platforms (e.g., J2EE, .NET).”*

*UML Infrastructure, Feb. 2007 (p. 9)

Birth of a giant…

Diagram types

Diagram type ranking* (UML 1.1)

  1. Class Diagram
  2. Use Case Diagram (4th rank for safety-critical software)
  3. Sequence Diagram
  4. Statechart Diagram (2nd rank for safety-critical software)

*Nebraska-Lincoln university report

UML Structure


Class versus Object



Class versus Object cont'd


Attribute property

Class attribute

Operation (as instance operation)


Association (cardinality, role and constraint*)

*{unique} and {unordered} are default constraints on association ends. {nonunique} and {ordered} are counterparts when default constraints do not apply.

Association (cardinality and role)

Association (constraint*)


context Criminal case inv:
    witness->intersection(accused person)->isEmpty()

Exercice « Le président d'une association loi 1901 peut (aussi) être secrétaire mais non trésorier »




context Promotion campaign inv:
    promotion offer[code on the Web]->size() <= 1

Association (navigation)

Exercice « Insérer la notion de « droite »
y = a * x + b »

Straight line

context Segment inv:
    1st end.x = 2nd end.x implies 1st end.y <> 2nd end.y
context Segment inv: A1
    straight line = Straight line.allInstances()->select(sl | sl.a = (2nd end.y – 1st end.y) / (2nd end.x – 1st end.x) and sl.b = 2nd end.y - sl.a * 2nd end.x)
context Segment crossing inv: A2
    segment = Segment.allInstances()->select(s | location.y = s.straight line.a * location.x + s.straight line.b)
context Point inv: A3
    straight line = Straight line.allInstances()->select(sl | y = sl.a * x + sl.b)
context Segment crossing inv:
    segment.straight line.point->includes(location)

Association class

Association class cont'd*


N-ary association*


From n-ary association to binary association*


context Borrowing inv:
    let b : Borrowing in 
    self.book copy = b.book copy implies self = b

Association versus attribute*


context Borrowing inv:
    let b : Borrowing in 
    self.book copy = b.book copy implies self = b

Derived association

context Family inv:
    self.good pool = self.individual.good

Package Diagram

Exercice difficile « Cartes activité » ici

Exercice « Gestion de Production Assistée par Ordinateur (GPAO) Articles & Nomenclatures de fabrication » ici

Exercice facile Amazon Prime Video, Netflix, OCS… Modéliser Series, Series type: TV Crime Drama, US TV Show, New Release, etc., My List, Arrêt dans la saison, etc.

Aggregation (white diamond)

Composition (black diamond)

Composition, subtlety


context Moteur inv:
    not self.voiture.oclIsUndefined() implies self.camion.oclIsUndefined()


Inheritance constraints*


Power type

Multiple inheritance

{redefines} constraint

Exercice « Ne pas mélanger les choux et les carottes » ici

UML Requirements engineering

Use Case Diagram, use case relationship types

Use Case Diagram, use case modeling variations

Use Case Diagram, use case extension points and owned behaviors

Exercice « Restaurant » : Boire, Commander, Commander avec modif. plat(s), Diner, Se restaurer, Déjeuner, Dresser la table, Débarrasser la table, Payer, etc.

« Restaurant », Class Diagram

Download as Modelio project

« Restaurant », Use Case Diagram

UML Behavior

Behavior (core metamodel evolution up to ver. 2.5.1)

UML Activity

UML Activity Diagram versus UML State Machine Diagram

UML Activity Diagram, activity versus action

UML Activity Diagram, action interruption

UML Activity Diagram, activity edge (i.e., BPMN link event)

UML Activity Diagram, activity as business process

UML Activity Diagram, execution

UML Activity Diagram, condition

Exercise “Belongings drop-off and pick-up at the Museum Of Modern Art (MOMA) of New York City”

Requirements doc.

Two distinct lanes are for, respectively, drop-off and pick-up.

After a waiting period in the drop-off lane, visitors reach a numbered desk. They lay down on the desktop all their belongings for a photography. Staff may optionally remind people that bags are totally unauthorized in the MOMA to effectively get all their belongings. The photography is recorded along with a phone number. Staff store belongings while a MMS is sent with the taken photography as “deposit proof”. A light panel (assigned to the numbered desk) turns then leave/green when the MMS succeeds (checked through the desk's computer). In case of “erroneous” phone number, light panel keeps displaying wait/red. To that event, visitors are invited to re-propose something valid until success.

Pick-up leads visitors to reach any numbered desk from the pick-up lane. After a waiting period, at business area, visitors are asked for their phone number. People get their belongings and leave the place when leave/green occurs. This results from staff enactment on their desk's computer.

Note that a numbered desk's light panel turns wait/red as soon as a sensor detects presence in front of the desk.

Drop-off at the NYC MOMA

Download as MagicDraw project

Pick-up at the NYC MOMA

Download as MagicDraw project

UML State Machine

UML State Machine Diagram, state & event

UML State Machine Diagram, entry, do & exit

UML State Machine Diagram, internal transition

UML State Machine Diagram, nesting

UML State Machine Diagram, input & output state

UML State Machine Diagram, execution

UML State Machine Diagram, guard & invariant

UML State Machine Diagram, orthogonality (in operator)

UML State Machine Diagram, execution* (orthogonality)

*Possible execution paths:

See also here for execution

UML State Machine Diagram, event sending (UML 1.1)

UML State Machine Diagram, event sending (UML 2.x)

UML State Machine Diagram, completion transition

UML State Machine Diagram, history*

* See also here and there… for execution

UML State Machine Diagram, fork & join

UML Interaction

UML Activity Diagram, interaction overview

UML Sequence Diagram, interaction overview

UML Collaboration Diagram versus UML Communication Diagram, interaction overview

UML Collaboration Diagram (no longer in ver. 2.5.1…)

UML Sequence Diagram

UML Sequence Diagram, extended notation

Behavior segment markers: alt, opt, par, seq, break, critical, neg & strict

UML Sequence Diagram, Alcatel Submarine Networks

UML Sequence Diagram, part behavior

UML Sequence Diagram, composite behavior

UML Sequence Diagram, timing issue

Timing issue (why UML Timing Diagram may be considered useless…)

Timing modeling pattern

© Franck Barbier