Java中探测算法_基于Java源码的设计模式探测初探

CN431258/ TP  ISSN 1007130X     计算机工程与科学 COMPUTER ENGINEERING &SCIENCE 2005 年第 27 卷第 1 期    Vol27 ,No11 ,2005  文章编号 :10072130X(2005)010099203 基于Java 源码的设计模式探测初探ΞResearch of the Design Pattern Detection Based on the Java Source Code 徐正权 ,但蕾蕾 XU Zheng2quan ,DAN Lei2lei( 华中科技大学计算机科学与技术学院 ,湖北 武汉 430074) ( School of Computer Science and Technology, Huazhong University of Science and Technology, Wuhan 430074 , China ) 摘  要 :设计模式探测是从源码中提取设计模式实例的过程 ,其搜索算法是探测的关键。文中分析了设计模式探测的一般步骤和搜索策略 ,通过实现从Java 源码中搜索 Factory Method 模式的算法 ,给出了设计模式自动探测工具的搜索功能实现原型。 Abstract :Design pattern detection is the process of identifying the design pattern instances in the existing source code. The search al2gorithm is the keyfor the detection. This paper describes the general steps and different search approaches for the design pattern detection. Using the Factory Method Pattern as a running example for detecting the design pattern instances in the Java source code , it provides a search function prototype for automatic design pattern detection tools. 关键词 :设计模式探测 ;Java ;搜索算法 ;自动探测工具 Key words :design pattern detection; Java ; search algorithm; automatic design pattern detection tool 中图分类号 :TP311                  文献标识码 :A 1  引言 设计模式探测 (Design Patterns Detection) 是从源代码中提取设计模式实例的过程 ,是设计模式研究的重要新兴课题之一。 设计模式探测有助于理解复杂设计。软件文档已经开始记录应用的设计模式 ,开发设计模式的探测工具 ,可以把采用的设计模式重新找到 ,以此重建设计 ,为已有系统的文档管理和系统维护提供支持。探测还可以提高代码优化的效率。设计模式不能随意使用 ,一个设计模式只有当它提供的灵活性是真正需要的时候 ,才有必要使用[1] 。对代码进行设计模式探测 ,可以据此去掉不必要的模式实现 ,提高优化效率。 2  设计模式探测 2. 1  探测标准 在设计

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值