janetsmith
janetsmith

Reputation: 8732

How to use UML to model interaction between server and agent?

Scenario:

  1. The agent listens to a certain address/port during start up.
  2. When server started, server will send message to agent via the address (multicast). Agent will reply the server.

How to model the first statement using UML (sequence diagram/activity/statemachine) ?

Upvotes: 0

Views: 1146

Answers (1)

roll
roll

Reputation: 126

I guess any of these types of diagrams could model the interaction, but I would go with a sequence or a communication diagram for these reasons:

  • there is a mix of asynchronous (the server's message) and synchronous (the agent's response) messages;
  • we aren't modelling state changes either in the server or in the agent.

This would be my take on a sequence diagram for the interaction (could possibly include more agents/port listeners to show the multicast):

Server-agent interaction - sequence diagram

And on a communication diagram (Agent 0 and Agent 1 could just be called Port Listener 0 and Port Listener 1):

Server-agent interaction - communication diagram

Statement (1), which I take to be the agent listening to the address or port, is shown as a self-call in both cases.

Here are a couple of amusing articles on sequence diagrams:

Upvotes: 3

Related Questions