首页> 中文期刊> 《计算机科学》 >一种基于UML关系的Java代码库构造方法

一种基于UML关系的Java代码库构造方法

         

摘要

关系信息是体现代码结构和语义的最重要的一类信息,如继承、聚合、组合、依赖、调用和创建实例等.为了更好地支持开源代码的理解与复用,提出了一种基于UML2关系的代码库构造方法.它以图数据库为实现平台,采用语言工程中经典的抽象语法树作为基础,并针对Java语言的特性和机制,设计富语义的Java代码属性图数据模型,在此基础上使得Java代码的图结构持久化.同时,为了屏蔽各种编程语言社区对代码中关系信息理解的差异性,采用UML2.4国际标准版本中定义的关系类型及语义解释,设计相应的代码关系抽取算法,为图节点添加对应的关系边.针对代码图化后的膨胀及代码库的空间存储消耗情况,选取9个常见的开源项目进行了实验评估.最后,给出了基于此代码库的查询应用实例.%Relationship information is the most important information representing code structure and semantics,such as inheritance,aggregation,composition,dependency,call and creation.This paper provided a method constructing source repositories based on relationships defined in UML2 for better comprehension and reuse of the open source code.The graph database is used as the implementation plantform of the approach,and the abstract syntax tree is adopted as the base of graph schema.In addition,the schema is designed specifically according to the Java language so that semantics can be well presented.The key point of the approach is that the relationship definitions are prescribed strictly according to the UML2.4 specifications,which is an ISO version,so that the differentiation between different language communities about the comprehension of relationship can be eliminated.Each category of the relationships was studied and the corresponding recognition algorithms were designed.During the construction of the repository,the relationships are added as different kind of edges.The evaluation experiments of 9 open source projects were conducted to illustrate the expansion of the code graph and the consumed space.At last,two simple case studies of querying on the repository were given.

著录项

相似文献

  • 中文文献
  • 外文文献
  • 专利
获取原文

客服邮箱:kefu@zhangqiaokeyan.com

京公网安备:11010802029741号 ICP备案号:京ICP备15016152号-6 六维联合信息科技 (北京) 有限公司©版权所有
  • 客服微信

  • 服务号