摘要
现有研究不能从状态模式的代码中恢复状态转换图这一状态模式的核心语义信息。针对状态驱动的转换这种典型实现方式,通过分析类型传播图确定状态模式的状态变量在各次赋值前后所属的具体状态类,并由此恢复该模式的状态转换图。给出了具体算法,通过实例分析验证了方法的可行性。
Existing researches can't recover state translation graph from codes of state pattern, which is the core semantic of state pattern. An approach is proposed to recover state translation graph from codes of typical implementation of state pattern. By analysis of type propagation graph, the approach figures out which concrete state class the current state variable belongs to before and after it has been assigned, and thus the state transition graph is recovered. The algorithm of the approach is presented, and the effectiveness of the approach is verified by a case study.
出处
《计算机与数字工程》
2010年第1期71-73,154,共4页
Computer & Digital Engineering
基金
国家自然科学基金重大研究计划和重点项目(编号:90818027
60633010)
国家高技术研究发展计划(八六三计划)目标导向类项目(编号:2009AA01Z147)
国家自然科学(编号:60873049
60803008
60903026)
江苏省自然科学基金项目(编号:BK2006094
2008292)
武汉大学软件工程国家重点实验室开放基金(SKLSE20080717)资助
关键词
设计模式
状态模式
类型传播图
状态转换图
design pattern, state pattern, type propagation graph, state translation graph