java Wicket 对阵 Vaadin

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/3553693/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-10-30 02:22:57  来源:igfitidea点击:

Wicket vs Vaadin

javawicketriavaadin

提问by joshua

I am torn between Wicket and Vaadin. I am starting a micro-isv and need to make a choice of web framework. I have narrowed down my choices to Wicket and Vaadin. I have used both frameworks and I love them both. however I need to make a choice.

我在 Wicket 和 Vaadin 之间左右为难。我正在启动一个 micro-isv,需要选择 web 框架。我已将选择范围缩小到 Wicket 和 Vaadin。这两个框架我都用过,我都喜欢。但是我需要做出选择。

If If I choose Vaadin:

如果如果我选择 Vaadin:

  1. I wont have to worry much about the look and feel. It comes with nice themes.
  2. I will do all my programming in Java which am very good at and wont have to spend time hacking CSS which am not very good at.
  3. And most of the components that I will need for a business applications are there OUT OF THE BOX including, desktop like layout, tooltips, Keyboard shortcuts, tables with draggable and collapsible columns to name a few.
  1. 我不必太担心外观和感觉。它带有漂亮的主题。
  2. 我会用我非常擅长的 Java 进行所有编程,而不必花时间编写不太擅长的 CSS。
  3. 我的业务应用程序所需的大多数组件都是开箱即用的,包括桌面布局、工具提示、键盘快捷键、带有可拖动和可折叠列的表格等等。

However, if I go the Vaadin way:

但是,如果我采用 Vaadin 方式:

  1. I will loose the ability to create UI declaratively.
  2. I wont have the fallback feature if the browser doesn't support JavaScript - e.g most non Webkit mobile browsers.
  3. Vaadin company is selling some components - e.g the JPAContainer so am not sure the company will be committed to offering full open-source framework. Business interests will always come first.
  4. Vaadin applications will be mostly for the intranet. They are not very suitable for the internet with a web look and feel.
  1. 我将失去以声明方式创建 UI 的能力。
  2. 如果浏览器不支持 JavaScript,我将不会有回退功能 - 例如大多数非 Webkit 移动浏览器。
  3. Vaadin 公司正在销售一些组件——例如 JPAContainer,所以我不确定该公司是否会致力于提供完整的开源框架。商业利益永远是第一位的。
  4. Vaadin 应用程序将主要用于内联网。它们不太适合具有 Web 外观和感觉的 Internet。

If I go the Wicket way:

如果我采用 Wicket 方式:

  1. I will have to style my applications and I can hardly give them a desktop look and feel.
  1. 我将不得不为我的应用程序设计样式,而且我几乎无法为它们提供桌面外观和感觉。

Any advice? Anyone with experience on either framework kindly tell me the cons and pros and how you made your decision.

有什么建议吗?任何对任一框架有经验的人都请告诉我优缺点以及您如何做出决定。

采纳答案by Karussell

I think I've invested some time for both frameworks. I really like both because they bring the Swing-alike coding to web development. And I don't know easier ones for me (although there is click but I don't like the velocity templating thing)

我想我已经为这两个框架投入了一些时间。我真的很喜欢两者,因为它们将类似 Swing 的编码带入了 Web 开发。而且我不知道对我来说更简单的(虽然有点击但我不喜欢速度模板的东西)

And yes, there are differences.

是的,存在差异。

I wont have to worry much about the look and feel.It comes with nice themes

我不必太担心外观和感觉。它带有漂亮的主题

true, but every serious company will style its app differently (unless you are prototyping)

是的,但每个认真的公司都会对其应用程序进行不同的设计(除非您正在制作原型)

I will do all my programming in java which am very good at and wont have to spend time hacking css which am not very good at

我将使用我非常擅长的 Java 进行所有编程,而不必花时间编写不太擅长的 css

Then Vaadin would be 'better'.

那么 Vaadin 会“更好”。

i will loose the ability to create UI declaratively.

我将失去以声明方式创建 UI 的能力。

What are the advantages of that? (BTW: you could code declarative in groovy ;-))

这样做有什么好处?(顺便说一句:你可以在 groovy 中编写声明性代码 ;-))

But ok. I know what you mean: if you can effort a separate designers than wicket is 'better'.

但是没问题。我知道您的意思:如果您可以努力设计一个单独的设计师,那么 wicket 就“更好”。

i can hardly give them a desktop look and feel.

我几乎不能给它们桌面外观和感觉。

Why not? Or what do you mean here? Wicket supports ajax and there are components which supports nice 'desktop-alike' things (ajaxlink, lazycomponent, autocompletion, progressbar, see wicket stuff + extensions). ok, for any more complex component you'll have to code in javascript BUT BTW did you know that you could even use GWT within wicket

为什么不?或者你在这里是什么意思?Wicket 支持 ajax,并且有一些组件支持很好的“类似于桌面”的东西(ajaxlink、lazycomponent、自动完成、进度条,请参阅 wicket 内容 + 扩展)。好的,对于任何更复杂的组件,您都必须在 javascript 中编写代码,但顺便说一句,您是否知道您甚至可以在 wicket 中使用 GWT

Some minor experiences:

一些小经验:

Vaadin is surely faster while coding (no css, html stuff). But if you go production keep in mind that the ease of programming can come to the cost of performance on the client side: e.g. if you use the 'wrong' layouts such as Horizontal/VerticalLayout, ... the massive use of javascript could slow down old browser.

Vaadin 在编码时肯定更快(没有 css、html 的东西)。但是,如果您进行生产,请记住,编程的简便性可能会降低客户端的性能成本:例如,如果您使用“错误”的布局,例如 Horizo​​ntal/VerticalLayout,...大量使用 javascript 可能会减慢关闭旧浏览器。

But Vaadin is not slow! Use appropriate layouts such as CssLayout or FastLayout and also old browser can serve it. (Although if you would use CssLayout your coding-style is really wicket-alike.)

但是 Vaadin 并不慢!使用适当的布局,例如 CssLayout 或 FastLayout,旧浏览器也可以提供它。(尽管如果您使用 CssLayout,您的编码风格真的很像 wicket。)

One issue with Vaadin is that it is a bit harder to profile, because you don't see easily where the client needs all the CPU and the nested divs gets cryptic id-names.

Vaadin 的一个问题是配置文件有点困难,因为您不容易看到客户端需要所有 CPU 的位置,并且嵌套的 div 获得了神秘的 id 名称。

One great thing about Wicket is its warp persist integration

Wicket 的一大优点是它的经纱持久集成

(Guice can be integrated in Vaadin and Wicket)

(Guice 可以集成在 Vaadin 和 Wicket 中)

Testing the UI should be easy with Vaadin (although I didn't found unit testing stuff) and is very easy with wicket.

使用 Vaadin 测试 UI 应该很容易(虽然我没有找到单元测试的东西)并且使用 wicket很容易。

Last but not least creating lists/tables is VERY easy in Vaadin compared to wicket.

最后但并非最不重要的一点是,与 wicket 相比,在 Vaadin 中创建列表/表格非常容易。

回答by BjornS

I've worked extensively with Wicket but I've not had any experience with Vaadin so this might be (a little) biased.

我与 Wicket 有过广泛的合作,但我对 Vaadin 没有任何经验,所以这可能(有点)有偏见。

I'd recommend Wicket for obvious reasons, but what's probably of interest to you is Wickets openness. As Gweebz rightly pointed out, Wicket uses basic HTML markup as its foundation, so any structural or cosmetic changes are often trivial to implement.

出于显而易见的原因,我推荐 Wicket,但您可能感兴趣的是 Wickets 的开放性。正如 Gweebz 正确指出的那样,Wicket 使用基本的 HTML 标记作为其基础,因此任何结构或外观上的更改通常都很容易实现。

Personally one of the things I really enjoy about out wicket work is the flow between front end presentation and the data backend, we've implemented Spring & JPA/Hibernate which means that any changes in the front end can be translated back into the data base with a single line of code thanks to Wickets model based architecture.

就我个人而言,我真正喜欢 wicket 工作的一件事是前端演示和数据后端之间的流程,我们已经实现了 Spring 和 JPA/Hibernate,这意味着前端的任何更改都可以转换回数据库由于基于 Wickets 模型的架构,只需一行代码。

Again I can't say much for Vaadin having never worked with it, but if you're looking for architectures to start off with, I'd also recommend you have a look at GWT.

再说一次,对于 Vaadin 从未使用过它,我不能说太多,但是如果您正在寻找开始的架构,我还建议您查看 GWT。

回答by hezamu

(continued from the comment in the first Wicket-related answer)

(从第一个与 Wicket 相关的答案中的评论继续)

The major difference between Vaadin and Wicket is with how UI composition and client side code is written. With Vaadin you usually compose your UI without any templates or HTML at all and you get a sleek, fully Ajax'ed UI out of the box. However, if you prefer the templating approach just use CustomLayout which does exactly that.

Vaadin 和 Wicket 之间的主要区别在于 UI 组合和客户端代码的编写方式。使用 Vaadin,您通常可以在没有任何模板或 HTML 的情况下编写您的 UI,并且您将获得开箱即用的时尚、完全 Ajax 的 UI。但是,如果您更喜欢模板方法,只需使用 CustomLayout 即可。

Client side coding is rarely needed, but when it is you do it with the Java-based GWT which is IMO a lot more nicer than writing Javascript by hand. Besides, with GWT you automatically get cross-browser compliant solution instead of having to deal with those issues yourself.

很少需要客户端编码,但是当您使用基于 Java 的 GWT 进行编码时,IMO 比手动编写 Javascript 好得多。此外,使用 GWT,您会自动获得跨浏览器兼容的解决方案,而不必自己处理这些问题。

When comparing frameworks you also should take a look at community activity and documentation. With Vaadin both of those are excellent. Also note the Vaadin Directory which currently contains 100+ very useful UI components and other addons.

在比较框架时,您还应该查看社区活动和文档。有了 Vaadin,这两者都很棒。另请注意 Vaadin 目录,其中当前包含 100 多个非常有用的 UI 组件和其他插件。

回答by Jesse Webb

I have a limited amount of experience with each but I prefer Vaadin. It allowed a richer experience with the web application I was developing. The main benefit that sold us though was how easy it was to write unit tests around our UI classes, ensuring the components functioned correctly when interacted with in the expected ways. This is also possible with Wicket however it was more difficult in my experience.

我对每个人的经验有限,但我更喜欢 Vaadin。它为我正在开发的 Web 应用程序提供了更丰富的体验。然而,卖给我们的主要好处是围绕我们的 UI 类编写单元测试是多么容易,确保组件在以预期的方式交互时正确运行。Wicket 也可以做到这一点,但根据我的经验,这更困难。

I will also mention that either framework will require some styling. Wicket starts off as plain old HTML and Vaadin starts off with a MacOSX-like theme by default but almost any web-app you write will require at least SOME customization. With this in mind, customizing the CSS of a Wicket app is SIGNIFICANTLY easier than Vaadin for the simple reason that you control the markup. Vaadin hides the markup from you and generates elements with weird IDs and structures so it is harder to customize the look. Just remember this when making your decision.

我还将提到这两个框架都需要一些样式。Wicket 以普通的旧 HTML 开始,而 Vaadin 默认以类似 MacOSX 的主题开始,但几乎您编写的任何 Web 应用程序都至少需要进行一些自定义。考虑到这一点,由于您控制标记的简单原因,自定义 Wicket 应用程序的 CSS 比 Vaadin 容易得多。Vaadin 对您隐藏标记并生成具有奇怪 ID 和结构的元素,因此很难自定义外观。做决定时请记住这一点。

回答by Cavaleiro

I am currently working with Wicket and I have worked in the pass with Vaadin. I wil be short in my observations:

我目前正在与 Wicket 合作,并且我曾与 Vaadin 合作过。我的观察很简短:

  • Vaadin is entitled to be free but IMO, is not so beautiful like that. If you need support, help, documentation for that painful and tricky problems that you encounter, then you are screwed because you do not have so good documentation/community when compared with Apache Wicket. Vaadin have guys to help you, but you have to pay for it.;
  • To program in wicket you need to be a strong programmer. Vaadin also requires good Java knowledge but you can easily do some spaghetti code if you want (just saying, not doing..);
  • Apache Wicket really separate the web technologies (Javascript, HTML, etc.) from the framework technology (Java). Vaadin also try to do it, but IMO is not so elegant and transparent on that.
  • Vaadin 有权获得自由,但 IMO 并没有那么美。如果您需要支持、帮助和文档来解决您遇到的那些痛苦和棘手的问题,那么您就完蛋了,因为与 Apache Wicket 相比,您没有那么好的文档/社区。Vaadin 有一些人可以帮助您,但您必须为此付出代价。
  • 要在 wicket 中编程,您需要成为一名强大的程序员。Vaadin 还需要良好的 Java 知识,但如果您愿意,您可以轻松地编写一些意大利面条式代码(只是说,不做..);
  • Apache Wicket 真正将 Web 技术(Javascript、HTML 等)与框架技术(Java)分开。Vaadin 也尝试这样做,但 IMO 在这方面并不是那么优雅和透明。

Appart from that, we are talking about two different types of frameworks, two different approach, which have pros and cons that I advice you to search and compare and see what really fits your needs.

除此之外,我们正在讨论两种不同类型的框架,两种不同的方法,它们各有利弊,我建议您搜索和比较,看看什么真正适合您的需求。

Edit: Oh, and about the look and feel, for instance you always have Wicket Bootstrap

编辑:哦,还有关于外观和感觉,例如你总是有Wicket Bootstrap

回答by Ishan Thilina Somasiri

Also do notice that even though Vaadin base framework is free, for some additional functionality you might need to buyextensions.

另请注意,尽管 Vaadin 基础框架是免费的,但对于某些附加功能,您可能需要购买扩展。

Ex - If you need to integrate a good charting solution such as Highcharts, you'd have to pay and buy the vaadin charts extension (even though highcharts is available free for FOSS apps, the vaadin charts plugin built on that is not given free for FOSS apps).

Ex - 如果您需要集成一个好的图表解决方案,例如 Highcharts,您必须付费购买 vaadin charts 扩展(尽管 highcharts 可免费用于 FOSS 应用程序,但基于此构建的 vaadin 图表插件不是免费提供的) FOSS 应用程序)。