Search code examples
umluse-caseuse-case-diagram

Can two actors both required for a usecase be the same person?


I have been presented with the following use case diagram.

Activity case

The given question was "How many people are required for the Use Case?".

I was taught, that Actors are used to model certain roles in the domain and that a "real" person can take multiple roles.

Going strictly by that definition, a single person with both roles should be enough, but I am not sure whether I am missing something, since intuitively there should be a reason, why there are two actors present. Can a single "real" person be enough here?


Solution

  • The question seems to assume that actors are people. However this is not the case: an actor can be another system interacting with the subject of your use case.

    So strictly speaking, if A and B would be systems, then no people would be required at all.

    But even if all actors in the diagram would be humans: the multiplicity of actors in your diagram is not specified. This creates an ambiguity. Most people assume it means 1, i.e. 1..1, i.e. a mandatory actor. As Axel explained in the comment, this would be the correct interpretation of the UML specs (it's not written black on white, but some inferences allow to deduct it). However many people also used to represent an association of a use-case with all primary actors that can possibly be involved without explicitly mentioning a 0..1 optional multiplicity (probably because it was newly introduced with UML 2.5). Therefore, in practice there is still an ambiguity if both actors are really mandatory.

    Finally, as you already rightly analysed and Bruno confirmed, even if both actors would be required it could be the same person.