简体   繁体   English

Google Web Toolkit vs Straight Javascript适用于大型复杂的应用程序?

[英]Google Web Toolkit vs Straight Javascript for reasonably large & complex application?

I've got a web conferencing client written predominantly in Java/Swing with some JNI native modules for stuff like: video, audio, and desktop sharing. 我有一个主要在Java / Swing中编写的Web会议客户端,其中包含一些JNI本机模块,用于:视频,音频和桌面共享。 In total the client is about 400k lines of Java code not including native modules. 客户端总共约有400,000行Java代码,不包括本机模块。

We are investigating a long term plan for migrating away from Java/Swing and toward HTML5/Javascript for the client. 我们正在研究从Java / Swing迁移到客户端的HTML5 / Javascript的长期计划。 As of right now, browser support is shaky/non-existent for some of our needs such voip, web cam video, and desktop sharing. 截至目前,浏览器支持对我们的一些需求(如voip,网络摄像头和桌面共享)不稳定/不存在。 So in the short term we could perhaps ship a browser plugin to do these things along with HTML5/JAvascript to do everything else. 所以在短期内我们可能会发布一个浏览器插件来执行这些操作以及HTML5 / JAvascript来完成其他任务。

For something of this complexity (basically a rich desktop client being ported to the web) what would make more sense: GWT (Google Web Toolkit) or straight Javascript using a JS library such as jQuery ? 对于这种复杂性(基本上是一个移植到Web上的富桌面客户端),更有意义的是:GWT(Google Web Toolkit)还是​​使用JS库(如jQuery)的直接Javascript?

EDIT: There are currently 5 developers working on this project. 编辑:目前有5个开发人员在这个项目上工作。

Take the google wave product as an example. google wave产品为例。 It was merged from plain old javascript to GWT to support more rapid development, especially considering the many developers concurrently working the project. 从简单的旧javascript合并到GWT以支持更快速的开发,特别是考虑到许多开发人员同时使用该项目。

In my experience, manually hacking a site of what you're suggesting with jQuery would be an awful lot of work which most likely will suffer from refactoring issues, difficulty to reuse code, and probably end up with alot of code that will be really hard to grasp for any new developers coming into the team. 根据我的经验,手动黑客攻击你用jQuery建议的网站将是一项非常多的工作,很可能会受到重构问题,重用代码的困难,以及可能最终会遇到很多难以实现的代码掌握任何进入团队的新开发人员。

Don't get me wrong jQuery is really great javascript tool; 不要误会我的意思jQuery是一款非常棒的javascript工具; but when writing complete applications in it, it quickly becomes unmanageable. 但是当在其中编写完整的应用程序时,它很快就变得无法管理。 That's at least my opinion. 这至少是我的意见。

If you have programmers with Java background, there are plenty of reasons why to use GWT: 如果你有程序员具有Java背景,那么使用GWT有很多原因:

  • powerful statically typed language also @client side 强大的静态类型语言也@client方面
  • rapid development (!!!) 快速发展 (!!!)
  • tools! 工具! IDEs, PMD, FindBugs and gazillion other. IDE,PMD,FindBugs以及其他众多产品。 Also configuring Eclipse with Google plugin is just piece of cake, unlike many other frameworks. 与许多其他框架不同,使用Google插件配置Eclipse也只是小菜一碟。
  • permutations for various browsers are already handled by GWT itself 各种浏览器的排列已经由GWT本身处理
  • your JavaScript is optimized - handled by GWT 您的JavaScript已经过优化 - 由GWT处理
  • you STILL CAN use plain JavaScript if you want (however GWT is designed the way you don't have to) 如果你愿意,你仍然可以使用纯JavaScript(但GWT的设计方式是你不需要的)
  • GWT is really scalable. GWT真的可扩展。 Your Java back-end will stay true Java, so you can use whatever favorite powerful java libraries 您的Java后端将保持真正的Java,因此您可以使用任何最喜欢的强大的Java库
  • client side development is quite robust and Swing-like, not too hard to find a programmer to fit there 客户端开发非常强大,像Swing一样,不太难找到适合那里的程序员

And many others. 还有很多其他人。 Honeslty, JavaScript is still quite slow (okay not to troll - language doesn't have "speed", but you get me). Honeslty,JavaScript仍然很慢(好吧不要拖钓 - 语言没有“速度”,但你得到我)。 It doesn't matter if you are using jQuery or GWT. 如果你使用jQuery或GWT并不重要。 Face it, it isn't going to perform as fast as thick client. 面对它,它不会像胖客户端那样快。 So why to sacrifice your comfort :) 那么为什么要牺牲你的舒适:)

From my experience, GWT is great for developing web applications where the intent is to mimic the look and feel of a desktop application. 根据我的经验,GWT非常适合开发Web应用程序,其目的是模仿桌面应用程序的外观。 The fact that your team already seems to have plenty of Java/Swing experience would make this migration path easier than directly moving to a pure-JavaScript solution. 您的团队似乎已经拥有大量的Java / Swing经验,这使得迁移路径比直接转移到纯JavaScript解决方案更容易。

Using pure JavaScript to build a desktop-style web application, you'll be finding yourself searching for or using a lot of libraries/toolkits/plugins/widget builders (even with the use of jQuery) just in order to get the basics down. 使用纯JavaScript构建桌面风格的Web应用程序,您将发现自己正在搜索或使用大量库/工具包/插件/小部件构建器(即使使用jQuery),只是为了降低基础知识。 These basics can easily be provided by GWT. GWT可以轻松提供这些基础知识。

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

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