以方便定位流程的实现和提高定位代理的适用性为妇矗,对State和Strategy设计模式在基于SUPL的A—GPS终端侧定位代理中的应用进行了研究。设计了终端侧定位代理的架构,描述了各个模块的功能,给出了State和Strategy设计模式在定位代理中的应用方案。采用State设计模式设计SUPL消息处理,保证了SUPL协议状态机的快速跳转和支持协议的扩展;采用qtrategy设计模式设计具体定位消息封装类,使定位代理能够根据实际网络动态地应用不同的定位数据传输流程。通过对设计模式的合理运用。减少了定位代理软件的设计复杂度,扩大了定位代理的适用范围,使定位代理具有很好的扩展性和灵活性。
In order to facilitate the implementation of the locating agent and improve its adaptability, researches on the application of State and Strategy design patterns in the A- GPS set locating agent based on SUPL. It designs the architecture of the locating agent; describes the functions of each module, and then puts forward the application scheme of State and Strategy design patterns in the agent. The State pattern is used in the design of the SUPL message processing to ensure the quick jumping and future expansion of the SUPL protocol; the Strategy pattern is used in the design of the positioning message class to let the locating agent apply different positioning processing according to the actual different network. Using the design patterns properly can reduce the complexity of software design; expand the application scope of locating agent, and make the locating agent scalable and flexible.