Search code examples
javaumlsequence-diagram

UML Sequence Diagram Implementation


I have never completed a sequence diagram before and would like to know if my first attempt is correct.

This sequence diagram is to represent someone modifying a pre-existing scoresheet in a tennis game. This change is added to the database.

enter image description here

Is this a correct way to model this sequence?

Class Diagram For App class diagram


Solution

  • There are several problems

    • You confuse who asks and who does : visibly for you the messages 1, 2 and 3 are actions done by the user, but the notation indicates they are done by ModifyScore for 1 and 3, and by Database for 2.

    • In your explicit returns (1.2 and 6) you indicate actions, but they can only support the return value(s).

    • There is no link between the messages 1, 2 and 3, and the message 2 goes to the Database, and the message 3 has no consequences for the database. That cannot does what you expect.

    • It is very difficult to imagine the user asking something to the database

    Do you have a simplified version of the Java program you try to describe through the a sequence diagram ?