摘要
由于协议是不断完善和发展的,因此一个好的协议软件应该具有良好的可维护性、可复用性以及可扩展性。在研究和分析ALE协议的基础上,用FSM模型对该协议进行了描述,并且提出了一种面向对象的FSM实现方法。在这种方法中,FSM中要素(包括状态、事件、转移、行为)都用一个类来表示,并将这些类的对象按照状态转移图组合起来就形成了可执行的状态机。在修改或者扩展该状态机时,只需要改变这些对象的组合方式或者增加必要的对象,因此可以很方便的对状态机进行维护和扩展并且对其中的对象进行复用。
In this paper, an object-oriented approach to the implementation of Automation Link Establishment protocol of ALE system is presented. Due to the continual evolution and modification of the protocol, the protocol software should be reusable, extendable and maintainable. Based on the study and analyses of ALE protocol, Finite State Machine (FSM for short) is used for describing ALE protocol. After this, an object-oriented method used to implement FSM is presented. In this method, each element (states, events, transitions and actions) of FSM can be defined in one same class. Executable state machine can be achieved by combining objects of these classes according the diagram of state transition, and the modification and extension of state machine can be completed only by changing the combining method or adding necessary objects. Therefore, in this method, it is very easy to modify and extend the state machine, and reuse those objects in it. After the implementation of ALE protocol, a test is added to the protocol software. The results show the correct implementation and reliability of ALE protocol.
出处
《桂林电子工业学院学报》
2004年第2期9-12,共4页
Journal of Guilin Institute of Electronic Technology