Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Show condition in use case diagram

In my system, a user can have more than one role. Users with two roles or more can switch between roles. However, it's impossible to switch role for a user with only one role. How can I represent this fact in use case diagram?

enter image description here

Thank you.

like image 598
lenhhoxung Avatar asked Oct 19 '25 05:10

lenhhoxung


2 Answers

You shouldn't show that condition in the use case diagram. The use case diagram is meant to give you a helicopter view of the features of the application and hide all the details.

You can put the condition in the pre-condition of the use case. So if you put User must have more then one role as pre-condition then the use case doesn't even start if that condition is not true.

PS. I'm assuming that your Role is a different concept from the roles represented by the actors and that Role could have been Account or Group or something else.

like image 100
Geert Bellekens Avatar answered Oct 22 '25 00:10

Geert Bellekens


You don't. The actor represents a role he plays. And whether users can take certain roles is an organizational question. You might show a diagram with actors instances where you describe those organizational constraints.

You can use Generalization to show that there's a role hierarchy.

like image 32
qwerty_so Avatar answered Oct 22 '25 01:10

qwerty_so