摘要
在现代程序设计中,网络协议实现、游戏角色建模等很多复杂场景切换问题都可以用有限状态机来描述。本文将有限状态机概念与事件驱动模型结合,设计一种可复用的代码模板实现各状态转换的动态管理。该方法简洁高效,模块逻辑清晰,提高了系统的健壮性。
In modern programming, network protocol, game roles modeling and many other issues which include complex state switches can be described in finite state machine. In this paper, the theory of finite state machine is combined with event-driven model, a reusable code template is designed to dynamically manage the state switch sense. This method makes logic of the code module clear and the system healthy.
出处
《计算机与现代化》
2014年第6期116-119,共4页
Computer and Modernization
关键词
有限状态机
事件驱动
状态切换
可复用框架
finite state machine
event-driven
state switch
reusable framework