What the difference between a self message and a return message. Here 2 examples:
Self Message:
Return Message:
Which example is correct?
A self-message is a message like any other, except that it has a special addressee. Typically you would implement the first example by having one operation of a class call another operation of the same object. Pseudocode:
class WebInterface {
…
public void showList() {
…
display();
…
}
public void display() {
…
}
…
}
A return message provides a result back to the caller. Typically for a synchronous message implemented with a call of an operation, it would correspond to the return of the value. Pseudocode:
class WebInterface {
…
public Display showList() {
Display display;
…
return display;
}
…
}
In your examples, you use an actor in the sequence diagram. In principle, an actor is external to the system whereas a sequence diagram shows message exchanges within the system. Although this practice is popular, it is ambiguous, because no semantics are defined for exchanging messages with a human being.
In this particular context it’s a more informal meaning :
display
operation within the web interface suggests that some displaying would take place. We implicitly understand that the user would get some visual feedback.If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With