0

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?

artas
  • 148
  • 1
  • 3
  • 12

1 Answers1

1

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.

qwerty_so
  • 35,448
  • 8
  • 62
  • 86
  • Thank's for answer, ok so is a specification level problem. in general there is no restriction on message meaning in sequence diagram? could i have a message from A to B that define an A operation instead of a B operation, modelled in a class diagram of a problem domain in a class A? my question is strictly related to sequence diagram and class diagram coherence. – artas Sep 01 '19 at 08:31
  • 1
    UML is about communication , not obeying strict language rules. And there's always "actio et reactio" which means sending a message corresponds to someone receiving it. You could write "Accept card" to make it more compliant. But I would never care about that (and I can get picky when it comes to certain details) in your above mentioned case. Often human ratio will just make it right. – qwerty_so Sep 01 '19 at 09:00