umlsequence-diagram

Should each item that participates in an interaction be present in the sequence diagram?


In a sequence diagram, I have an actor which interacts with:

  1. Four databases installed on Server A.
  2. A system (end user software) on Server B and the filesystem on the same server (folders for storage, etc.)

Should I represent each item as a separate entity, i.e. the actor, each database on server A, the software on server B and the filesystem on server B, resulting in a total of 7 entities?


Solution

  • With "entity" you probably mean lifelines, with a bubble at the top of a long line.

    The choice is yours. If you want to be complete, let each instance/object be represented as a lifeline. Alternatively you could choose to have only one of the four databases if the messages exchanges with all these databases are the same. (This is then called by some authors a "prototypical role" that corresponds in reality to several instances involved rather than a specific object.)

    Do only represent objects that participate in the interactions that you model. Moreover, it may be more readable to have several smaller diagrams rather than a big one. For example if in the main scenario the user exchanges some messages with the app, keep it that simple, and create a separate interaction diagram for the scenario where the user downloads some file from the app and the app interacts with the file system.

    P.S.: although it is common practice to have actors in a sequence diagram, keep in mind that interactions with human actors are very ambiguous in the modelling. Also, for the records, in theory the actor is external to the system, whereas lifelines are expected to belong to the system under consideration.