enterprise-architect - 在 Enterprise Architect 中建模网络交互的正确方法
问题描述
我有一个类Actor
,其实例发送/接收网络消息。(例如,该类的每个实例都是在不同物理机器上运行的不同进程的一部分。)网络消息是类的序列化实例,MessageA
其MessageB
属性通过线路发送。Actor
传入消息由我的类的回调方法方法处理。通过调用我的Actor
类的方法触发了一条消息。因此,我开始在类图中对这种情况进行建模,如下所示:
- 网络消息是 EA 术语中的“信号”,即具有特殊原型的类(为简洁起见,省略了属性)
- My
Actor
-class 是 EA 中的一个常用类,有四个对应的方法
现在,我想对一个典型的交互进行建模,并开始绘制以下时序图:
这些消息不是方法调用,而是异步的,并且有一种“信号”,允许我为它们分配正确的消息类型。
但是,我想知道我如何建模
带有有效负载的消息
MessageA
由onMessageAReceived
该方法
sendMessageA
发出带有有效负载的消息MessageA
(注意:就我的实现而言,
sendMessageA
返回 void 是正确的,因为发送网络消息是异步的,被卸载到底层操作系统,并且该方法在发送消息后返回给它的被调用者。)
在序列图中。
也许,我的整个方法是完全错误的,我试图建模一些无法像这样建模的东西。在这种情况下,非常欢迎一些指向正确方法的指针。
解决方案
Of course there's more than one way to model this (and it does not depend on the tool EA). So, you should ask which audience you are talking to, repsectively which their domain is basically.
Technical
A SD is well suited to show a physical transport. In that case you concentrate on the way how messages are sent. In this case you will have the physical operations shown as messages. E.g. using sockets, it would be some (a-)synchronous send(message)
which assures that the content message
is transported from A to B. This could be at any level of technical implementation from rough to single CRCs being sent (or how the operation is internally built to ensure packages are not lost).
Logical
In order to show a more logical aspect it's a good idea to have components (being deployed on multiple hardware) having ports (realizing some interface) along which you have an information flow (which is a connector you will find in EA) that can transport something (that is your message classes).
Overview
You might want to describe both aspects in your model. But likely you will have the focus on the one or other part depending on your overall domain.
There is no single way to model something. Models are always abstraction which is why we create models. They shall show reality, but more light weight.
推荐阅读
- postgresql - 你能在逻辑上复制一个物理 Postgres 副本吗?
- go - 了解 Golang 中的频道
- javascript - 将参数从一个 Axios 请求传递给另一个
- xamarin.forms - Xamarin Forms-如何重叠框架并突出显示选定的框架?
- python - tk.Listbox 的格式字符串
- node.js - 函数在nodejs中没有返回任何东西
- sql - SQL Server“组内搜索”
- excel - 每 n 行自动填充
- r - SelectizeInput 和 typeaheadInput :“删除”一个输入时是否还有更好的解决方案?
- python - RFID阵列参数到Python