9

除了 JavaScript 和 Java 之间的明显差异之外,使用 SmartClient 或 SmartGWT 的相关差异是什么?

4

6 回答 6

8

SmartGWT 是 SmartClient 的 GWT 包装器,正如您所说,这意味着您可以使用 java 编写 SmartGWT 应用程序。

根据我的经验,在您编程时唯一重要的区别是 GWT 包装器比直接使用 js 组件更具限制性。例如,以编程方式从 java 中滚动 TreeGrid 是地狱,因为底层表的主体(您需要获取它才能滚动爆炸的东西)不会通过 SmartGWT 公开,而它当然可以从 js 轻松访问。

总的来说,我不会根据这些差异在 js 组件和 gwt 包装器之间进行选择,但我会考虑您项目中的其他因素。您最熟悉哪种技术?你打算做多少定制?

于 2010-04-22T10:57:46.543 回答
5

就我而言,代码可维护性。

我们是 Python 之家。但是对于客户端代码,我们选择 GWT,最初使用 GXT,但现在使用 SmartGWT。

我们不喜欢 Java,但我们更不喜欢 JS,订购、维护多个小部件的库、扩展对象以提供自定义功能等。在 JS 或 Java 中这样做之间,选择是显而易见的,Java 方面。我们在这里编写可重用的组件,现在我们为客户端编写非常少的代码,只重用组件并使用 REST 与我们的 Python 后端通信。

我们知道 SmartGWT 比 SmartClient 更冗长,但是,通过 Netbeans 自动完成(这里的一些同事使用 Eclipse),我们可以直接访问记录的每个方法,而不是每次我们需要测试和尝试新的时候去展示柜或谷歌功能。

于 2011-01-28T15:37:02.453 回答
2

SmartGWT 为您提供了可以使用功能强大的编辑器的优势。

您可以轻松地调试自己的代码(但是这对于深入了解 smartclient 代码本身并不是很有帮助)。

你手头有 eclipse/netbeans 的所有自动完成功能。当开始使用 SmartClient/Gwt 时,它可以帮助您找到您正在寻找的东西,因为编辑器可以列出您的类或可用方法以及一些基本文档,这些类/方法实际上是做什么的。为您节省大量浏览文档的时间

于 2010-04-22T22:25:25.373 回答
1

Banang:访问 ListGrid / TreeGrid 主体的 API 现在在 Smart GWT 中公开。

于 2010-05-03T14:54:30.247 回答
1

我们选择使用 Javascript(没有 SmartGWT)......我更喜欢这种方式,尽管我们的一些团队成员(Javascript 新手)更喜欢 SmartGWT 方式。两者都有其优点和缺点:

使用 SmartGWT 的优点之一是您会遇到编译时错误,因为所有内容都先由 Java 编译器编译,然后再呈现为 Javascript。

One of the drawbacks of SmartGWT, is that it doesn't expose the full underlying Javascript Smartclient API. This means, if you want to do more advanced stuff, you might end up needing to do it in Javascript anyways.

Another drawback of SmartGWT, productivity wise, is that every single change you do and want to test, needs to go thru the painful Java EE compile/deploy process, whereas if you do it in Javascript, you can alter client side code faster by changing .js files directly without the need for the whole compile/deploy process.

于 2011-05-17T00:14:48.270 回答
0

SmartGWT is based on java code and when compiled it transforms it into java script, is a heavy since it transforms java code into js

SmartClient is a framework based on js, you can use its components in an xml page and you manipulate them in Js, and it’s light

le showcase de smartclient I recommend smartClient

于 2020-01-17T07:57:01.360 回答