Eclipse:最有用的重构 [英] Eclipse: Most useful refactorings

查看:138
本文介绍了Eclipse:最有用的重构的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我每一次都使用Eclipse重构功能。一些技术比其他人更明显,有些则从未尝试过。



什么重构对你而言最有用,为什么?



注意:我发现这个演示文稿非常有用,也许是因为它是例子驱动,因此易于理解:



为每个人重构 - 如何以及为什么要使用Eclipse的自动重构功能



编辑:这篇文章也很有用(感谢抖动)



在Eclipse JDT中浏览重构函数

解决方案



我决定采用更科学的方法来确定最常用的重构命令。 Eclipse具有内置的使用情况数据收集器(UDC)功能。数据为<一个href =http://www.eclipse.org/org/usagedata/results.php?kind=command&sort=element =noreferrer>公开可用。我拿出数据并提取了以下图表,它显示了最常用的编辑命令(没有导航命令)。



alt text http://img.skitch.com/20091207-bmcng36rjy837sqmcx58b85age.gif



但是,我非常信任格式化和组织导入的保存操作(请参阅​​我的文章),所以我不会算这些。我也会删除评论动作。图片如下所示: alt text http://img.skitch.com/20091207-ieas1mk5114fwitucqkqxyw6t.gif


Every now and again, I make use of the Eclipse refactoring feature. Some techniques are more obvious then others and some I never tried.

What refactoring is most useful for you and why?

Note: I find this presentation very useful, perhaps because it is example driven therefore easy to understand:

"Refactoring for everyone - How and why to use Eclipse's automated refactoring features"

Edit: This article is useful as well (Thanks jitter)

Explore refactoring functions in Eclipse JDT

解决方案

It is an interesting question. I know what works for me and it is interesting to see what others use.

I decided to take a more scientific approach to determine the most commonly used refactoring commands. Eclipse has a Usage Data Collector (UDC) feature built in. The data is publicly available. I took the data and extracted the following graph which shows the most commonly used editing commands (without navigation commands).

alt text http://img.skitch.com/20091207-bmcng36rjy837sqmcx58b85age.gif

However, I am a strong believer in "Save Actions" for formatting and organizing imports (read my article about it), so I wouldn't count those. I would also remove the commenting actions. The picture looks like this: alt text http://img.skitch.com/20091207-ieas1mk5114fwitucqkqxyw6t.gif

这篇关于Eclipse:最有用的重构的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆