简体   繁体   English

使用JST与JSF诉Seam进行联系

[英]Seam with JSF v. Seam with GWT

Would anyone be able to compare and contrast the two solutions? 有人能比较和对比这两种解决方案吗? I don't know much about Seam or JSF, though I am familiar with the way GWT works and very much like the theory of it. 我对Seam或JSF知之甚少,虽然我熟悉GWT的工作方式,非常喜欢它的理论。

Primary concerns: 主要关注点:

  • Scalability / performance 可扩展性/性能

  • Cross-browser compatibility 跨浏览器兼容性

  • Learning curve 学习曲线

  • Productivity 生产率

  • WYSIWYG UI building WYSIWYG UI构建

  • Capacity to code as much as possible in Java (I can touch JS/HTML/CSS if possible, but preferably not) 在Java中尽可能多地编码的能力(如果可能,我可以触摸JS / HTML / CSS,但最好不要)

Concerning the client-side development of your app we had the same decision to make. 关于您的应用程序的客户端开发,我们做出了同样的决定。

We decided to go for GWT for the following reasons: 我们决定选择GWT,理由如下:

  • Most of the development can be done in java. 大多数开发都可以在java中完成。 Since we have a strong background in java development this will save us a lot of time. 由于我们在Java开发方面有很强的背景,这将为我们节省大量时间。
  • We could use all the well known and beloved tools for implementing since all is done in java. 我们可以使用所有众所周知和受欢迎的工具来实现,因为所有工具都是在java中完成的。
  • Our app was going to be a desktop like, single page web application without complete page refreshes. 我们的应用程序将是一个类似桌面的单页面Web应用程序,没有完整的页面刷新。 At this point GWT seemed to fit best for that need (and it still does). 在这一点上,GWT似乎最适合这种需求(现在仍然如此)。
  • Pushing most of the state to the client and let him do most of the time consuming processing appealed to us. 将大部分状态推送给客户并让他做大部分耗费时间的处理都吸引了我们。 This way the server can handle lots of simultaneous request and connections to the server are only needed to sync the state on the client. 这样,服务器可以处理大量的同时请求,并且只需要在服务器上同步状态即可与服务器建立连接。
  • The support for Unit Testing GWT code is good, in conjunction with the MVP pattern even better. 单元测试 GWT代码的支持很好,与MVP模式相结合甚至更好。
  • Since the introduction of UiBinder creating and styling complex UIs has gotten a lot easier and faster. 由于UiBinder的引入创建和样式复杂的UI已经变得更容易和更快。

To your main concerns: 对您主要关注的问题:

  • Cross-browser compatibility is mainly taken care of by GWT itself. 跨浏览器兼容性主要由GWT本身负责。
  • WYSIWYG is possible with GWT Designer (I must say I've never used it; I like building the UI myself...) GWT Designer可以实现WYSIWYG(我必须说我从未使用过它;我喜欢自己构建UI ...)
  • GWT is really fast because the rendering is all done on the client-side. GWT非常快,因为渲染都是在客户端完成的。
  • Productivity is high when you're used to java. 当你习惯了java时,生产力很高。
  • The learning curve depends mainly on the architecture you use (MVP is complex at first). 学习曲线主要取决于您使用的架构(MVP最初很复杂)。
  • Your application will scale since the server is freed of much costly processing. 您的应用程序将扩展,因为服务器无需昂贵的处理。

Hope that helps. 希望有所帮助。

(Some considerations concerning the choice of Seam are coming soon from @kraftan). (有关Seam选择的一些考虑因素很快将来自@kraftan)。

Concerning the server-side implementation of your app you have to take the following point into account (pro/con is subjective, so you should decide) when using GWT instead of JSF. 关于应用程序的服务器端实现,在使用GWT而不是JSF时,必须考虑以下几点(pro / con是主观的,所以你应该决定)。

  • As mention by @z00bs, using GWT you'll have a desktop like app. 正如@ z00bs所提到的,使用GWT你会有一个类似app的桌面。 So you won't use/need page-navigation or page-action feature of Seam. 因此,您不会使用/需要Seam的页面导航或页面操作功能。
  • All requests from GWT to the server are short-running. 从GWT到服务器的所有请求都是短时间运行的。 That means, most of your components will be of ScopeType.EVENT or ScopeType.STATELESS and you don't need/use the conversation scope. 这意味着,您的大多数组件都是ScopeType.EVENTScopeType.STATELESS并且您不需要/使用会话范围。
  • Using GWT instead of JSF reduces the load on the server because you hold most of the state in the client. 使用GWT而不是JSF可以减少服务器上的负载,因为您拥有客户端中的大部分状态。
  • You cannot use the JSF/Seam-lifecycle with GWT. 您不能将JSF / Seam生命周期与GWT一起使用。 For instance, you lose the model validation part in the lifecycle. 例如,您在生命周期中丢失了模型验证部分。 Model validation will only be triggered by using the entity manager or manually 模型验证只能通过使用实体管理器或手动触发
  • All other feature, such as security, mailing, or EL, are still working when using Seam with GWT. 在使用带有GWT的Seam时,所有其他功能(例如安全性,邮件或EL)仍然有效。

Since Seam is well-known for its JSF support, you should consider another framework, such as Spring roo which is strongly related to GWT, too. 由于Seam以其JSF支持而闻名,因此您应该考虑另一个框架,例如与GWT密切相关的Spring roo

通过在客户端的内存中存储长期持续交易(如购物车),Seam提供的会话范围可以很容易地在GWT中替换。

Neither! 都不是! dont use seam (or jsf for that matter) if you absolutely dont have to! 如果你绝对没有必要,请不要使用seam(或者jsf)! There are so many better web techs on java. java上有很多更好的Web技术。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM