Search code examples
methodsumlmessagesequence-diagram

Sequence diagram: messages are invoking method?


my question is about the sequence diagram in uml.

In particular about the meaning of message.

in most slide,book and reference I found something like: "when an object A send message "doSomething" to an object B this tell that A is invoking a method of B"

now my question is about modelling situation like:

An user go to ATM and insert card in it. so intuitively I make this simple part of sequence: image

now insert card is an user action, and not a method of ATM object, but logically seems this have sense, because the actor and the ATM interacting in this way,

can i use sequence diagram like this? or I need to make another partecipant like "user" with insertCard method? depend on specification level?

so definetively, what is the meaning of a message? an invoking method or an interaction?


Solution

  • This is fine that way. It's just the level of detail that makes you stumble. The ATM has lots of sensors and actors to insert the card. Basically some sensor tells that a card is being inserted and it has to move the slider motor or whatever and read the card. But you are not interested in those details at this business level. Ergo: make it simple and stay with "Insert card".

    You could as well see that as a trigger hiding the gory details. See How to show event in a sequence diagram

    You may also refer to UML 2.5 p.596:

    enter image description here

    Your case is the first: a "message" to the ATM that a card is inserted.