Skip to main content
2 of 2
Minor rewording, making title more general, and improving layout (i.a. moving the question above the big diagram, for increased visibility)
Christophe
  • 82.2k
  • 11
  • 136
  • 202

In a sequence diagram, where do message parameters come from?

I'm drawing some sequence diagrams to give a graphical depiction of the use cases written during the requirements elicitation phase for my project. This is a simple one:

Vote Post Use Case

  • Precondition: the user must be logged and the post the user wants to vote exists

  • Postcondition: the post is voted by the user

  • Steps:

    • 1: the user reaches the posts (includes "View Post" use case)
    • 2: the user clicks the dedicated button, according to the vote he intends to cast that can be either a negative or positive vote
    • 3: the system registers the vote cast by the user. If the post was already voted by the user, the system will override the old vote with the new one.
    • 4: the system throws a visual feedback to indicate that the operation has been performed successfully

In the sequence diagram with the analysis objects for this use cases, there is a message votePost(user, post, vote). Where does the user argument come from?

complex sequence diagram

Currently I did it so that the boundary object PostPage calls votePost(user,post,vote), assuming that it has knowledge of the user entity associated to the actor participating in the use case. Is it a correct approach, or should a third control object (called AuthenticationControl) be involved in order to get the current user?

If deemed useful, this is a portion of a class diagram showing the relevant entities :

class diagram with user, post and vote

cidra
  • 363
  • 4
  • 11