知识卡片
状态机明确事件守卫与动作
状态机把历史抽象为当前状态,事件触发迁移,守卫条件决定当时是否允许,迁移动作以及进入退出动作说明发生什么。它可表达内部与环境刺激及定时约束,补充结构的完整行为。汽车音响例区分关机、收音、载入和播放CD,以及有效盘片和弹出条件;不要把一个按钮事件等同每种状态都会执行同一操作。
这张卡片看不懂?
这张卡片的反馈已满 10 条,暂时无法继续提交。
已有反馈 · 0 / 10 条
还没有人提交反馈。
在整书笔记中的位置
原书出处 · 1 处
- 记录架构文档 · 查看原书依据
Each transition in a state machine diagram is labeled with the event causing the transition. For example, in Figure 22.4, the transitions correspond to the buttons the driver can press or driving actions that affect the cruise control system.
参考来源
- 位置:《Software Architecture in Practice, 4th Edition》第22章《记录架构文档》(来源项目:book-sources;源文件:extracted/Software Architecture in Practice, 4th Edition/_epub-src/ch22.html)
- 结论依据:原文解释状态机把历史抽象为当前状态,事件触发迁移,守卫条件决定当时是否允许,迁移动作以及进入退出动作说明发生什么;本章后续机制、例子与条件共同限定本卡,原书经验数字和前景不视为当前实测或现状。
- 原始内容:Each transition in a state machine diagram is labeled with the event causing the transition. For example, in Figure 22.4, the transitions correspond to the buttons the driver can press or driving actions that affect the cruise control system.