Uml sequence diagram - modeling of general behavior that applies to operations

I have a sequence diagram where a client makes an initial call to set up a session. After this initial call, each subsequent operation (for example, call X, call Y, call Z) called on the server is checked for a session. Is there a way to describe this behavior as a whole without having to show it for each call? I guess one option is to add a note, but maybe there is a better way?

session sequence diagram

+4
source share
2 answers

Since the sequence diagram shows the specific implementation (Client and Server should be: Client and: Server in the diagram), it is difficult to enter factorization. You can use InteractionUse to reuse a sequence fragment, but in this case it will not help, since you have only one message ("check session").

Do not forget that diagrams are types of systems, and especially sequence diagrams - this is viewing a specific transaction. You do not need to show everything on the chart. You do not need to show the “check session” messages in this diagram and use another one to show that the server always checks the session, perhaps with a state diagram.

+4
source

In all sequence diagrams, I include preconditions, summaries, and postconditions in one diagram note. This prevents a lot of confusion and subsequent questions from reviewers. Prerequisites include any required initialization and execution. In this case, the prerequisite may be a “session setup script”.

+2
source

Source: https://habr.com/ru/post/1493405/


All Articles