我应该如何使用 QM 建模工具实现正交组件
我了解如何编码正交组件,如下所述: http://www.state-machine .com/resources/Pattern_Orthogonal.pdf。我的问题是 QM 只允许每个活动对象有一个状态图。如何最好地对“组件”状态图进行建模,因为它与“容器”状态图位于同一活动对象中。
有接受者吗?
I understand how to code an orthogonal component as described here: http://www.state-machine.com/resources/Pattern_Orthogonal.pdf. My problem is that QM only allows one statechart per active object. How do I best model the "component" statechart seeing as it is in the same active object as the "container" statechart.
Any takers?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您需要将组件建模为从 QHsm 或 QFsm 派生的单独类(它确实是)。其余部分如“正交分量”模式描述中所述。也就是说,您需要 (1) 将 Component 实例嵌入到 Container 中,(2) 从 Container 的最顶层初始转换触发 Component 的最顶层初始转换,以及 (3) 显式地将事件分派到成分。请记住,组件需要将事件(异步)发送到容器。
You need to model the Component as a separate class (which it really is) derived from QHsm or QFsm. The rest is as described in the "Orthogonal Component" pattern description. That is, you need to (1) embed the Component instance inside the Container, (2) trigger the top-most initial transition of the Component from the top-most initial transition of the Container, and (3) explicitly dispatch events to the Component. Please remember that the Component needs to post (asynchronously) the events to the Container.