在哪里可以找到Eclipse插件开发的设计模式和最佳实践

时间:2022-11-15 03:25:17

Our team is developing a Eclipse based IDE (typically a plugins), currently we are progressing good but I feel somehow we are feeling smell of bad practices in code. Example I can give here is, eventListeners :

我们的团队正在开发一个基于Eclipse的IDE(通常是一个插件),目前我们进展得很好,但是我感觉我们在代码中闻到了糟糕实践的味道。我可以举个例子,eventlistener:

Consider we have button named button1 and in the same java file (just below the button) we are adding selection listener to it like:

假设我们有一个名为button1的按钮,在同一个java文件(就在按钮下面)中,我们向它添加了选择监听器,比如:

button1.addSelectionListener(new SelectionListener() {
    //Remaining code here
}

Which I feel is completly bad idea, and my question, is there any design pattern, best practices etc available for eclipse plugin development? Or do you have any small tips/suggestions for the same? I know there are books available like Code Complete 2 etc etc, but I need bit suggestions respect to eclipse plugin development.

我觉得这完全是一个坏主意,我的问题是,是否有任何设计模式,最佳实践等用于eclipse插件开发?或者你有同样的小建议吗?我知道有一些书可以下载,比如Code Complete 2等等,但是我需要一些eclipse插件开发方面的建议。

I tried in Google and didn't get much good informations regarding same, I got this IBM's article. But I feel it's not very useful, any suggestions or tip is appreciated.

我在谷歌上试过,但是没有得到太多关于这个的信息,我得到了IBM的这篇文章。但是我觉得它并不是很有用,任何建议或建议都是值得感激的。

Note: Please let me know if it is not appropriate here or is it good for anyother stackexchange networks (like programmers), I can move it there.

注意:如果这里不合适,或者其他的stackexchange网络(比如程序员),我可以移动它,请告诉我。

2 个解决方案

#1


11  

After several years of plugin development, I find these resources to be most useful for me when I find myself struggling on how to implement new feature:

经过几年的插件开发,当我发现自己在如何实现新特性上遇到困难时,我发现这些资源对我最有用:

  1. Eclipse sources. Nothing will beat this. Try to find some already existing analogic part of what you're just doing and look how Eclipse developers did it - what patterns and extensions they used and so on. Helps to keep you plugins consistent with other parts of Eclipse. Eclipse Plugin Spy is your friend here (Alt + Shift + F1/F2).

    Eclipse的来源。没有什么会打败这个。尝试找到一些已经存在的类似的部分,看看Eclipse开发人员是如何做的——他们使用了什么模式和扩展等等。有助于使插件与Eclipse的其他部分保持一致。Eclipse插件Spy是您的朋友(Alt + Shift + F1/F2)。

  2. Platform Plug-in Developer Guide - will guide you through basic concepts of Eclipse, like how to create menus properly, implement an editor, or save user preferences.

    平台插件开发人员指南——将指导您了解Eclipse的基本概念,比如如何正确地创建菜单、实现编辑器或保存用户首选项。

  3. Eclipse Plug-ins (4th Edition) - Well known must-have for plugins developer.

    Eclipse插件(第4版)——众所周知的插件开发人员必备的插件。

And, of course, Stack overflow :)

当然,堆栈溢出:)

#2


7  

I like to add some more resources that I have found useful to dreo's answer. The eclipse sources are invaluable, if you want to understand something in detail. To understand global concepts however, I suggest to read as much tutorials as you can. I can recommend the following websites:

我想补充一些我发现对dreo的回答有用的资源。如果您想了解一些细节,eclipse源代码是无价的。但是,为了理解全局概念,我建议尽可能多地阅读教程。我可以推荐以下网站:

Eclipse Corner Articles Has a lot of tutorials ranging from basic concepts to plugins specific topics.

Eclipse角文章有很多教程,从基本概念到插件特定主题。

Vogella Eclipse Tutorials Also a good tutorial website. It deals with a lot of topics that are important for Eclipse RCP development.

Vogella Eclipse教程也是一个很好的教程网站。它处理许多对Eclipse RCP开发很重要的主题。

SWT Snippets More than 100 code snippets. Really useful, if you want to learn more about SWT and its capabilities.

SWT片段超过100个代码片段。非常有用,如果您想了解更多关于SWT及其功能的信息。

The Official Eclipse FAQs Last but not least, I can recommend the official Eclipse FAQs. They provide compact solutions for a variety of topics.

官方的Eclipse常见问题最后但同样重要的是,我可以推荐官方的Eclipse常见问题。它们为各种主题提供紧凑的解决方案。

#1


11  

After several years of plugin development, I find these resources to be most useful for me when I find myself struggling on how to implement new feature:

经过几年的插件开发,当我发现自己在如何实现新特性上遇到困难时,我发现这些资源对我最有用:

  1. Eclipse sources. Nothing will beat this. Try to find some already existing analogic part of what you're just doing and look how Eclipse developers did it - what patterns and extensions they used and so on. Helps to keep you plugins consistent with other parts of Eclipse. Eclipse Plugin Spy is your friend here (Alt + Shift + F1/F2).

    Eclipse的来源。没有什么会打败这个。尝试找到一些已经存在的类似的部分,看看Eclipse开发人员是如何做的——他们使用了什么模式和扩展等等。有助于使插件与Eclipse的其他部分保持一致。Eclipse插件Spy是您的朋友(Alt + Shift + F1/F2)。

  2. Platform Plug-in Developer Guide - will guide you through basic concepts of Eclipse, like how to create menus properly, implement an editor, or save user preferences.

    平台插件开发人员指南——将指导您了解Eclipse的基本概念,比如如何正确地创建菜单、实现编辑器或保存用户首选项。

  3. Eclipse Plug-ins (4th Edition) - Well known must-have for plugins developer.

    Eclipse插件(第4版)——众所周知的插件开发人员必备的插件。

And, of course, Stack overflow :)

当然,堆栈溢出:)

#2


7  

I like to add some more resources that I have found useful to dreo's answer. The eclipse sources are invaluable, if you want to understand something in detail. To understand global concepts however, I suggest to read as much tutorials as you can. I can recommend the following websites:

我想补充一些我发现对dreo的回答有用的资源。如果您想了解一些细节,eclipse源代码是无价的。但是,为了理解全局概念,我建议尽可能多地阅读教程。我可以推荐以下网站:

Eclipse Corner Articles Has a lot of tutorials ranging from basic concepts to plugins specific topics.

Eclipse角文章有很多教程,从基本概念到插件特定主题。

Vogella Eclipse Tutorials Also a good tutorial website. It deals with a lot of topics that are important for Eclipse RCP development.

Vogella Eclipse教程也是一个很好的教程网站。它处理许多对Eclipse RCP开发很重要的主题。

SWT Snippets More than 100 code snippets. Really useful, if you want to learn more about SWT and its capabilities.

SWT片段超过100个代码片段。非常有用,如果您想了解更多关于SWT及其功能的信息。

The Official Eclipse FAQs Last but not least, I can recommend the official Eclipse FAQs. They provide compact solutions for a variety of topics.

官方的Eclipse常见问题最后但同样重要的是,我可以推荐官方的Eclipse常见问题。它们为各种主题提供紧凑的解决方案。