Siva
Siva

Reputation: 1325

Threads in Class Diagram (UML)

How do we show a thread is invoked and inturn invokes other threads in UML Diagram.This looks more like a WorkFlow. Is it possible to represent in UML

Upvotes: 5

Views: 7814

Answers (3)

Andrea Sindico
Andrea Sindico

Reputation: 7440

UML is a language with a very structured syntax and semantics. See the UML specification at http://www.omg.org/spec/UML

To answer your question consider that in UML a Thread is an active class. The UML Class meta-class in fact owns a boolean attribute named isActive with the semantics you need. An active class owns a classifier behavior which is the behavior that will be atuomatically executed, for each object, as soon as the class is instantiated. If the behavior is modeled by means of an activity or an interaction in which other active classes are instantiated (Create action) then this is semantically similar to a thread spawning other threads.

Upvotes: 1

sfinnie
sfinnie

Reputation: 9952

Agree with @Yasin, Sequence Diagram might do the job.

Activity Diagram is another option that's well suited for showing workflow. Parallelism, threads, synchronisation etc. are definitely one of the sweet spots and arguably easier to understand in an Activity Diagram than a Sequence Diagram.

hth.

Upvotes: 1

Yasin Bahtiyar
Yasin Bahtiyar

Reputation: 2367

Sequence Diagram should do the work.

Upvotes: 4

Related Questions