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
- 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
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
Now here'sIn the sequence diagram with the analysis objects for this use cases:
This, there is a portion of my entity class diagram:
The question is: where does the user argument inmessage votePost(...user, post, vote) should come from?. Where does the user argument come from?
Currently iI 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 partecipatingparticipating 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 :

