Java GUI编辑器为快速开发和可维护性(即Eclipse / SWT和Netbeans / Matisse)提供了什么? [英] What does either Java GUI editor offer for rapid development and maintainability (i.e., Eclipse/SWT and Netbeans/Matisse)?

查看:179
本文介绍了Java GUI编辑器为快速开发和可维护性(即Eclipse / SWT和Netbeans / Matisse)提供了什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在Eclipse / SWT或Netbeans / Matisse之间,Java GUI编辑器在快速开发和可维护性方面为您提供了什么?

解决方案

你真的在问两个不同的问题:SWT vs Swing,Eclipse GUI Editor和Netbeans GUI Editor(Matisse)。



首先,SWT和Swing之间的区别他们是两个根本不同的GUI库。这类似于要求Tk和Win32之间的区别,或Java Swing与.NET Forms(不是说SWT是.NET)的区别。讨论SWT与Swing有很多讨论 - 我不了解SWT来总结差异。



首先,让我说我的偏见是赞成Netbeans,并且从Forte的日子开始,已经花了10年时间学习IDE。



就GUI编辑而言,Eclipse和Netbeans具有功能相似的产品,但是实现代码以非常不同的方式。



我的观察结果是Matisse的行为,功能和生成的代码让人想起Visual Studio .NET代码。某些对象(如JTable)有明确的初始化部分和自定义行为。您可以通过GUI编辑器轻松地从初始化到设置各个属性自定义一个对象并添加您自己的任意代码。对于事件处理,它默认使用匿名内部类和调用独立方法在.NET中复制委托。 GUI编辑器本身提供对表单对象模型的详细访问,并具有丰富的自定义设置。您还可以自由地将非GUI bean放入GUI组件(如模型(tablemodel,listmodel等),JPA相关对象,工作人员等)使用的表单中。过去花了一周的时间用手工制作编码的SWING与马蒂斯(Matisse)需要一天的时间(尽管您必须真正学习马蒂斯这样做)。如果您已经手动编程了多年,那么重新学习使用GUI编辑器 有效地 将是一个漫长而艰苦的课题。



代码从Matisse内部高度可维护;它不是要在Matisse之外进行编辑,但如果需要,代码适合编辑(许多人知道使用Netbeans GUI,然后将源代码复制到Eclipse中)。



Eclipse GUI编辑器是一个非常不同的生物。 GUI编辑器在总体能力方面大致相同,但是我发现它们的磨光程度较低。布局功能大致相同,尽管错误有时候不那么宽容。一些自定义需要我直接访问源文件并编辑文件,而不是通过GUI访问代码自定义。生成的代码与马蒂斯非常不同。 GUI组件通过getter添加和初始化,并分散在整个文件中;这很好,因为每个组件被隔离/分组成一个单一的功能,但是当您需要诊断组件初始化之间的不良交互时很麻烦。事件处理程序也是一样的 - 与matisse非常不同。



Eclipse也没有提供任何对我的编辑/打破/篡改生成的GUI文件的保护, Netbeans对它的保护几乎是讨厌的。就可维护性而言,Eclipse代码可能更接近于人类将生成Java代码的方式...个人来说,我发现它生成的代码更难维护,但是我一直在看Matisse生成的代码,因为第一个beta,所以我的意见在这个问题上是不客观的。



Netbeans还有能力使用相同的编辑器构建Swing框架应用程序,Netbeans RCP等...我不确定Eclipse是否也一样。


Between Eclipse/SWT or Netbeans/Matisse, what does either Java GUI editor give you in terms of rapid development and maintainability?

解决方案

You are really asking two different questions: SWT vs Swing, and Eclipse GUI Editor vs Netbeans GUI Editor (Matisse).

First, the difference between SWT and Swing is that they are two fundamentally different GUI libraries. This akin to asking the difference between Tk and Win32, or Java Swing vs .NET Forms (not to say that SWT is .NET). There are a lot of discussions out there discussing SWT vs Swing--I don't know enough about SWT to summarize the differences.

First, let me say my bias is in favor of Netbeans and I have spent 10 years learning the IDE from its days as Forte.

As far as the GUI editor, Eclipse and Netbeans have functionally similar products, but implement the code in very different ways.

My observation is that Matisse behaves, functions, and produces code that's reminiscent of Visual Studio .NET code. There are clear initialziation sections and custom behaviors for certain objects (such as the JTable). You can "Customize" an object and add your own arbitrary code via the GUI editor very easily for everything from initialization to setting individual properties. For event handling, it defaults to replicating "delegates" in .NET by using anonymous inner classes and invoking a stand-alone method. The GUI editor itself provides detailed access to the form object model and has a rich set of customizations. You also have the freedom to drop non-GUI beans into the form for use by GUI components, such as models (tablemodel, listmodel, etc), JPA-related objects, Workers, etc. What used to take a week to produce with hand-coded SWING takes a day with Matisse (though you have to really learn Matisse to do this). If you've been hand-coding swing for many years, then relearning to use a GUI editor effectively is going to be a long, hard lession.

The code is highly maintainable from within Matisse; it is NOT intended to be edited outside of Matisse, but the code is suitable for editing if you needed to (many folks I know use Netbeans GUI and then copy the source into Eclipse).

The Eclipse GUI editor is a very different creature. The GUI editor(s) are roughly the same in terms of overall capability, but I have found them to be less polished. The layout capabilities are about equal, though errors are a bit less forgiving at times. Some customizations required me to go to the source file and edit the file directly, rather than getting access to code customizations through the GUI. The code produced is very different than Matisse. GUI Components are added and initialized through "getters" and is scattered throughout the file; this good because each component is isolated/grouped into a single function, but troublesome when you need to diagnose bad interactions between component initialization. The same goes with the event handlers--very different than matisse.

Eclipse also did not provide any protections from me editing/breaking/tampering with the produced GUI file where as Netbeans was almost obnoxious with its protections. As far as maintainability, the Eclipse code is probably a little closer to the way a human would produce Java code... personally, I find the code it produces harder to maintain, but I've been looking at Matisse generated code since the first beta so my opinion is hardly objective on this issue.

Netbeans also has the capability of using the same editor for building Swing framework applications, Netbeans RCP, etc... I am unsure if Eclipse does the same.

这篇关于Java GUI编辑器为快速开发和可维护性(即Eclipse / SWT和Netbeans / Matisse)提供了什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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