摘要
由于移动应用的数据来源主要依靠网络通讯,随着移动应用的广泛应用和不断发展,其网络通讯模块设计愈加重要.而现有的采用参数-URL接口的通讯模式,通常具有数据耦合度高,请求结果处理不灵活,请求数据点多且离散,与后台协同开发效率低等问题.针对这些问题,本文基于指令驱动模型,提出完全面向对象思想的网络模块封装,通过采用方法直达式的请求过程,应用JSON格式实现对请求数据和返回数据的端到端处理,而接口测试基本由服务器端完成.所提出的面向对象的网络通讯方式有利于降低数据耦合度,提高请求结果处理的灵活性,便于与后台协同开发和接口测试,从而降低后台接口编写的复杂度,提高应用程序可读性和可扩展性.
As the data source of mobile application mainly relies on network communication,meanwhile with the wide application and continuous development of mobile application,the design of its network communication module becomes more and more important.The existing communication mode with parameter-URL interface usually has the problems of high data coupling,inflexible processing for requesting result,multiple and discrete request data points,low efficiency of collaborative development with the back-end.To solve these problems,this paper proposed a fully object-oriented network encapsulation module based on the instruction driven model.Through the direct request process with methods,the JSON format was used to realize the end-to-end processing of request data and return data,while the interface test was basically completed by the server.The proposed object-oriented network communication method is conducive to reducing the data coupling,improving the flexibility of request result processing,facilitating the collaborative development and interface testing with the back-end,thus reducing the complexity of back-end interface writing,and improving the readability and scalability of application programs.
作者
侯杰
王静
王乐琪
HOU Jie;WANG Jing;WANG Le-qi(College of Information Technology,Shanghai Ocean University,Shanghai 201306,China;Key Laboratory of Fishery Information,Ministry of Agriculture,Shanghai 201306,China)
出处
《小型微型计算机系统》
CSCD
北大核心
2020年第9期1858-1865,共8页
Journal of Chinese Computer Systems
基金
国家自然科学基金项目(61806123,41871325)资助
上海市青年科技英才扬帆计划项目(16YF1415700)资助
上海海洋大学骆肇荛大学生科技创新基金项目(A1-2004-00-201334,A1-2004-20-201334)资助。
关键词
移动应用
网络通讯
面向对象
指令驱动
mobile application
network communication
object-oriented
instruction-driven