我应该选择哪个框架 - Seam、Wicket、JSF 还是 GWT?
我正在考虑是否使用 Seam、Wicket、JSF 还是 GWT 作为 Java 项目中表示层的基础。
根据就业市场的考虑、技术的新颖性以及其他 SO 用户的建议,我将 Java Web 框架的选择范围缩小到了这个子集。
在做出这些决定时我应该考虑哪些因素?
I'm debating whether to use Seam, Wicket, JSF or GWT as the foundation for my presentation layer in a Java project.
I narrowed my selection of Java web frameworks down to this subset based on job market considerations, newness of the technology and recommendations from other S.O. users.
What factors should I take into consideration in deciding among these?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(11)
我从 1.4 版本开始就使用 GWT,从 2.0 规范发布以来我就使用 JSF。
GWT 是一个客户端框架,它从 Java 生成 JavaScript。 您的架构将是一个纯粹的客户端-服务器,这意味着:
JSF 是一个基于组件的框架,具有视图优先的设计(如果你愿意,可以在代码隐藏):
简历:
I've used GWT since version 1.4 and JSF since the 2.0 spec came out.
GWT is a client-side framework, it generates JavaScript from Java. Your architecture would be a pure client-server, which means:
JSF is a component-based framework, with a view-first design (code-behind if you like):
Resume:
我使用过的唯一一个是 JSF,因此我无法向您提供有关其他产品的反馈,但这是我对 JSF 的看法。 根据我的经验,当我们从 JSP 中的 JSF 转换为 Facelets 中的 JSF 时,生活就变得容易多了,所以我将重点关注 Facelets。 而且,看起来 Seam 和 JSF 并不相互排斥。
优点:
通过 faces-config简单 :
我绝不是 JSF/Facelets 方面的专家,所以我确信还有其他我错过的。 希望其他人也能详细说明。
JSF 2.0 更新:
The only one of those I've used is JSF, so I won't be able to give you feedback on the others, but here's my take on JSF. In my experience, the minute we converted from JSF in JSP to JSF in facelets, life got MUCH easier, so I'll focus around facelets. Also, It looks like Seam and JSF are not mutually exclusive.
Pros:
Cons:
I'm by no means an expert in JSF/Facelets, so I'm sure there are others I've missed. Hopefully someone else will also elaborate.
Update for JSF 2.0:
感谢检票员保持清醒并继续讨论。 我是 wicket 用户,我喜欢它。 我的主要原因是:
我可以让设计人员在模板和页面上工作,就像我在 java 部件上工作一样
没有什么新内容学习。 它的“只是 java 和 HTML”
我以前的经验是 GWT 和 JSF 1.0
Thanks wicket guys for remaining sober and keeping over this discussion. I am a wicket user and i love it. My main reasons are :
I can let the designers work on the templates and pages as i work on the java parts
There is nothing new to learn. Its "just java and just HTML"
My previous experience is GWT and JSF 1.0
Seam 是一个应用程序框架,而不是真正的表示层。 它最初是为了减轻 JSF 的痛苦而开发的,但现已发展成为一个更通用的依赖注入框架。
我相信您可以将 Seam 与 JSF、Wicket 和 GWT 一起使用。 JSF 支持是主要且出色的; 我不确定其他两个的支持情况如何。
由于您的标准重点似乎是您的技能的适销性,因此我建议通过 Facelets 尝试 Seam 和 JSF。 JSF 是一个被广泛接受的标准,如果您使用 Facelets,实际上使用起来会很愉快。 您可以通过 Richfaces 和 Ajax4jsf 获得灵活的 AJAX 功能。 Seam 或多或少通过 JCP 实现了标准化。
Seam is an application framework, not really a presentation layer. It was originally developed to make JSF less painful, but has evolved into a more general purpose dependency injection framework.
I believe that you can use Seam with JSF, Wicket and GWT. JSF support is primary and excellent; I'm not sure how well the other two are supported.
Since the focus of your criteria seem to be the marketability of your skills, I would suggest trying out Seam and JSF via Facelets. JSF is a well accepted standard and is actually enjoyable to use if you are using Facelets. You can have slick AJAX functionality via Richfaces and Ajax4jsf. Seam is being more or less standardized via the JCP.
我的经验是,按时间顺序排列:
原始 servlet - (是的,有很多艰苦的工作,但那是早期,我们是热心的海狸!)
JSP - 我认为这是它出来时的 beez neez (如果我们只知道;))
Echo - 很棒的框架,但不适用于需要搜索引擎友好的页面(相同
GWT 的问题)
Wicket - 很棒的框架 - 开发人员完全理解 OO 的概念(与 JSP 和许多其他框架不同),并将所有常见的 OO 细节应用到这个框架中。 如果您欣赏“可重用性”,如果您欣赏封装,如果您欣赏关注点分离,并且如果您喜欢将模型绑定到 UI 代码而不必担心对象编组和其他此类丑陋问题,那么这就是适合您的框架!
My experience is, in chronological order:
Raw servlets - (yeah, lot's of hard work but the it was early days and we were eager beavers!)
JSP - I thought it was the beez neez at the time it came out (if we only knew ;) )
Echo - Awesome framework but not for pages that need to be search engine friendly (same
problem with GWT)
Wicket - Awesome framework - the developers fully understand the concept of OO (unlike JSP and many others) and have applied all the usual OO niceties to this framework. If you appreciate 'reusability', if you appreciate encapsulation, if you appreciate separation of concerns and if you like to bind your model to the UI code without having to worry about object marshalling and other such ugliness then this is the framework for you!
从长远来看,我建议使用 Sun 规范支持的技术。 到目前为止,这已被证明可以提供多种实现方式以供选择(通常也是开源实现),而且行为往往得到很好的定义。
这将在维护场景中为您提供帮助,希望您的代码也能及时完成。 编写良好的代码永远存在:)
在这种特殊情况下,我建议使用 JSF。 我只尝试过 1.1 的 Apache 实现,但在 JSP 之上感到很痛苦。 我们将很快对其进行修改 - 我希望研究在 Facelets 上使用 JSF。
In a long term scenario I'd recommend using technologies backed by a Sun specification. This has so far proven to give multiple implementations resulting in choice (frequently also open source implementations), plus behaviour tends to be very well defined.
That will help you in a maintainance scenario, which - hopefully - your code will end up too in time. Well-written code lives forever :)
In this particular scenario I would suggest JSF. I have only tried the Apache implementation of 1.1, but it hurt to be on top of JSP. We are to revise it soon - I expect to look into having JSF on facelets.
我经常使用 Wicket 和 GWT。 从未真正学会爱威克特。
我的自我博客http://salk31.blogspot.com/2009/07 /wicket-ajax.html
今天查看 GWT 2.0 uiBinder,让我想起在 Wicket 中必须将 XML 组件树与 Java 创建的组件树相匹配是多么烦人。 对我来说,GWT 的旋转看起来要好得多。
我已经一年多没有使用 Wicket 了,所以也许他们已经解决了很多问题,但是考虑到现代浏览器和 JS 支持,我看不出在服务器上执行所有这些操作的意义(我知道,我知道数据局部性)。
I've used Wicket and GWT pretty heavily. Never really learned to love Wicket.
My ego blogged about it http://salk31.blogspot.com/2009/07/wicket-ajax.html
Looking at GWT 2.0 uiBinder today reminded me how annoying it was in Wicket to have to match the XML component tree with the one created in Java. The GWT spin on this looks vastly better to me.
I've not used Wicket for over a year so maybe they have fixed a lot of this but given modern browser and JS support I can't see the point of doing all this on the server (I know, I know data locality).
如果你只考虑就业市场,你应该选择JSF。 但是,我相信 RIA 的未来属于 GWT 和类似 gwt 的客户端技术。
我认为 GWT 最明显的优点是它比服务器端表示层技术(例如 JSF、wicket)具有更好的可扩展性。 因为,服务器不需要存储客户端状态,并且客户端的CPU功率也被使用。这是一个巨大的好处,你不需要在服务器计算机之间序列化客户端状态来实现容错系统。
If you consider only job market , you should choose JSF. But, I belive that the future of RIA belongs to GWT and gwt like client side technologies.
I think that the most obvious upside of GWT, it is better scaleable than server side presentation layer technologies such as JSF, wicket. Because , server does not need to store client state and the client cpu power also are also used.. It is a huge benefit, you dont need to serialize client state between server computers to achive fault tolerant system.
我知道现在有点晚了,但是 Framewrok 上已经有很多比较,特别是这个,发生在 Devox 2010 conf 期间:
http://www.devoxx.com/display/Devoxx2K10/Comparing+JVM+Web+Frameworks
这应该可以帮助您选择:)
I know it's a bit late but there is already lot of comparison on Framewrok, espcially this one, wich occured durinf Devox 2010 conf :
http://www.devoxx.com/display/Devoxx2K10/Comparing+JVM+Web+Frameworks
This should help you to choose :)
我从 JSF(1.1 和 1.2)开始,这非常痛苦,所以我决定在下一个项目中进行更改。 我做了一些研究,决定尝试一下 Wicket,这真是太愉快了。
我也尝试过 JSF 2,但仍然是同样的事情。
它们都是组件框架,但是使用 Wicket 很容易,而使用 JSF 则一团糟。
Wicket over JSF:
JSF over Wicket:
一个常见的缺陷是会话大小是个问题(因为图形组件存储在其中)。
总而言之,如果您必须在 Wicket 和 JSF 之间做出决定,那么对我来说毫无疑问,Wicket。
I started with JSF (1.1 and 1.2) and it was so painful that I decided to change in next projects. I researched a bit and I decided to try Wicket, and it was so a pleasure.
Also I've tried JSF 2 but is still the same thing.
Both of them are component frameworks, but things with Wicket are easy while with JSF are a complete mess.
Wicket over JSF:
JSF over Wicket:
One common flaw is that session size is are problem (because graphical components are stored in there).
All in all, if you have to decide only between Wicket and JSF there not doubt for me, Wicket.
JSF 已被弃用(2010 年传道者比较或谈论 Web 框架时,JSF 甚至没有被列为可比较的框架)。
现在,成熟的大型应用程序是使用 GWT、YUI、JQuery 等创建的。
阅读 google 及以上的一些文章就会很明显。
(JSF 上的所有作业都是为了支持遗留应用程序)。
JSF is deprecated (JSF is not even listed as a framework to compare when evangelists compare or talk about web frameworks in 2010).
Now full fledge large scale applications are created using GWT, YUI, JQuery etc.
Read some articles over google and above will be obvious.
(ALL JOBS on JSF are to support legacy applications).