如何在时序图中显示提交到线程池的命令 [英] How to show commands submission into thread pool in sequence diagram

查看:48
本文介绍了如何在时序图中显示提交到线程池的命令的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在准备序列图.根据命令设计模式创建为命令的任务被提交到线程池并执行.

I'm preparing sequence diagram. where tasks created as commands according to command design pattern are submitted into thread pool and executed.

让我们假设 command 执行一些来自 Data 类的方法.

Let's assume that command execute some methods form Data class.

这是我的问题:

我不知道我是否应该专门绘制命令对象,或者只是从调用程序传递到线程池的简单submitTask()"消息.

I don't know if i should draw command object specifically, or just simple 'submitTask()' message passed from invoker into thread pool.

我不知道我是否应该绘制 workerThread 对象,或者只是简化它,以便调用 Data 类函数.

I dont't know if i should draw workerThread object, or just simplify it, to thead pool calling Data class functions.

我不知道如何将排队命令表示到线程池中,然后执行它们.

I don't know how to represent queueing commands into thread pool, and then their executions.

我知道,有点乱,也许最后一个问题是最重要的.期待您的回答!

I know, a lil bit chaotic, mayby the last question is the most important. Looking forward for your answers!

推荐答案

Any SD 不显示任何 可能的消息组合,而是显示一个单独的场景. 所以想想是哪些最重要的是创建相应的图表.

Any SD does not show any possible message combination but one single scenario. So just think which ones are most important and create the according diagrams.

实际实现队列的方法有很多.这将是一些示例实现:

There are many, many ways to actually implement your queue. This would be some sample implementation:

Threading 有两个端口.一个用于排队请求,一个用于再次将它们取出.

Threading has two ports. One for queuing requests and one to get them out again.

这篇关于如何在时序图中显示提交到线程池的命令的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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