UML – Are Actors Objects in Sequence Diagram?

sequence-diagramuml

The most likely answer is no, but I've come with this doubt. Can an actor act as a class?

I know actors trigger events and can have prompts, but if there's a class modeling an actor (such as an user class) can we call methods over them? Or is this a complete misunderstanding of the actor role, which is getting mixed with the representative class?

Supposed as correct:

Supposed Correct Example

Doubt if correct:

enter image description here

Best Answer

In UML, an Actor is always something (a system or person) that is outside the scope of the system/software that you are building. It would be completely wrong to equate an actor with an instance/object of a class that happens to model certain aspects of the actor in your system.

In the shown UML diagrams, the actor "User" (with it's stick-figure icon) represents the real-world human being that operates your system. The class User represents a model of that person that captures the characteristics that are relevant for you. This class only exists within your system.
This makes that the class and the actor are two distinct entities and should also be shown as such in your diagrams.

Related Topic