如何使用 UML 对服务器和代理之间的交互进行建模? [英] How to use UML to model interaction between server and agent?

查看:37
本文介绍了如何使用 UML 对服务器和代理之间的交互进行建模?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

场景:

  1. 代理在启动期间侦听某个地址/端口.
  2. 当服务器启动时,服务器将通过地址(多播)向代理发送消息.代理将回复服务器.

如何使用 UML(序列图/活动/状态机)对第一条语句建模?

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

推荐答案

我想这些类型的图表中的任何一种都可以为交互建模,但出于以下原因,我会使用序列或通信图:

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:

  • 混合了异步(服务器的消息)和同步(代理的响应)消息;
  • 我们不会对服务器或代理中的状态变化进行建模.

这将是我对交互的序列图的看法(可能包括更多代理/端口侦听器以显示多播):

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

通信图上(Agent 0Agent 1 可以称为 Port Listener 0端口侦听器 1):

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

语句 (1),我认为是侦听地址或端口的代理,在这两种情况下都显示为自调用.

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:

这篇关于如何使用 UML 对服务器和代理之间的交互进行建模?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆