| 本文已被:浏览 2868次 下载 4652次 |
 码上扫一扫! |
|
|
| REST API设计分析及实证研究 |
|
周芯宇1,2, 陈伟1,2, 吴国全1,2,3, 魏峻1,2,3
|
|
1.中国科学院 软件研究所, 北京 100190;2.中国科学院大学, 北京 100049;3.计算机科学国家重点实验室 (中国科学院 软件研究所), 北京 100190
|
|
| 摘要: |
| REST API已成为访问和使用Web服务的重要途径, 为开发基于服务架构的应用系统提供了可复用接口. 但是, REST API的设计质量参差不齐, 因此有效、合理的设计指导规范对于规范和提高REST API设计质量具有现实意义和应用价值. 首先, 基于REST API的本质内涵, 建立了一个多维度、两层次的REST API设计指导规范分类体系RADRC (REST API design rule catalog), 并对当前主流的25条设计指导规范进行分类. 其次, 针对已有规范提出相应的检测方法, 并实现了REST API设计指导规范遵循情况的分析与检测工具RESTer. 最后, 使用RESTer开展REST API设计实证研究, 分析了APIs.guru收录的近2000个真实REST API的文档, 从中分析提取相应的REST API信息, 进一步检测并统计当前REST API的设计特征和设计指导规范遵循情况. 研究发现不同应用类别的REST API在资源和操作模式上存在差异, 使得不同类别REST API在设计规则和总体架构方面各有特点. 实证研究结果有助于深入了解当前REST API及其设计规则的特征、现状和不足, 对于提高REST API设计质量和改进设计指导规范具有实际意义. |
| 关键词: REST API 设计指导规范 分类体系 API描述文档 实证研究 |
| DOI:10.13328/j.cnki.jos.006383 |
| 分类号:TP311 |
| 基金项目:国家重点研发计划(2017YFB1400602); 国家自然科学基金重点项目(61732019); 并行与分布处理国防科技重点实验室基金一般项目(61421102000402) |
|
| REST API Design Analysis and Empirical Study |
|
ZHOU Xin-Yu1,2, CHEN Wei1,2, WU Guo-Quan1,2,3, WEI Jun1,2,3
|
|
1.Institute of Software, Chinese Academy of Sciences, Beijing 100190, China;2.University of Chinese Academy of Sciences, Beijing 100049, China;3.State Key Laboratory of Computer Science (Institute of Software, Chinese Academy of Sciences), Beijing 100190, China
|
| Abstract: |
| As an important way to access and use web services, REST API provides a technical means for developing and implementing service-oriented architecture-based application systems. However, REST API's design quality varies, so practical and reasonable design guidelines are essential for standardizing and improving REST API design quality. First of all, based on the connotation of REST API, a multi-dimensional, two-layered REST API design guideline classification framework REST API design rule catalog (RADRC) is established. Twenty-five popular design guidelines are classified based on RADRC. Secondly, a REST API design guideline compliance inspection tool, namely RESTer, is implemented. Finally, RESTer is employed to conduct an empirical study on current REST API design by analyzing nearly 2 000 real-world REST API documents from APIs.guru. RESTer analyzes the documents and extracts REST API design information for characterizing REST API design and inspecting compliance with the design guidelines. The empirical study finds that REST APIs of different application categories vary in resources and operation modes, making different categories REST APIs have the characteristics in terms of design guidelines and overall architecture. The empirical study results help understand the characteristics, status quo, and shortcomings of current REST APIs and their adoptions of design guidelines, which is practically significant to improve REST API design quality and design guidelines. |
| Key words: REST API design guideline catalog API document empirical study |