真实世界的 ZK 与 GWT 体验
我和一位开发人员同事正在整理一份新应用程序的提案,我们已经提出了 ZK 和 GWT 作为可能的选择。在搞乱了两者之后,我更愿意继续进行 ZK 概念验证,但该公司的一位“高级架构师”(甚至不在我们团队中)似乎正试图接管项目并告诉我们要采用哪些技术。他正在寻找任何借口将 GWT 推到我们身上并吹 ZK 犯规。
现在,我并不是说 GWT 本质上很糟糕,也不是说 ZK 是 Web 应用程序开发的万能工具,但我不喜欢由没有经验的人告诉我如何开发应用程序。确实做了足够的研究来推动一项特定的技术。虽然这个人不在我们的团队中,但管理层倾向于听他的,并且可能会“告诉”我们该使用什么。
这家伙反对ZK的论据似乎是“浏览器不兼容”、“浏览器中业务逻辑太多”、“项目不成熟”。我不同意这三点。他也没有为 GWT 提供任何论据,这看起来他实际上对这两种技术都不太了解。他还声称最好使用公司内部某人知道的技术。这里只有一个团队实际使用过 GWT,并且该项目存在……问题。
具有 ZK 和/或 GWT 实际经验的人是否可以提出一些我可以提供的论点,至少可以将这两种技术重新摆在桌面上,而不是试图在没有真正研究的情况下推动单一技术?
A fellow developer and I are putting together a proposal for a new application, and we've presented both ZK and GWT to be possible choices. After messing around with both, I'd prefer to move ahead with a ZK proof-of-concept, but one of the "senior architects" of the company (who isn't even on our team) seems to be trying to take over the project and tell us what technologies to employ. He's finding any excuse he can to push GWT onto us and call foul on ZK.
Now I'm not saying that GWT is inherently bad, nor that ZK is the be-all-and-end-all of web application development, but I don't like being told how to develop a application by someone who hasn't really done enough research to push a particular technology. Although this guy is not on our team, management tend to listen to him, and will probably "tell" us what to use.
This guy's arguments against ZK seem to be "browser incompatibility", "too much business logic in the browser", and "project immaturity". I disagree with all three of these. He also provides no arguments for GWT, which seems like he actually doesn't know much about either technology. He also claims that it's better to use a technology that someone within the company knows. There is only one team here that has actually used GWT, and that project has had... issues.
Could someone with some real-world experience with ZK and/or GWT suggest some arguments I can provide that would at least put both the technologies back on the table, rather than attempting to push a single technology with no real research?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(7)
GWT 和 ZK 都提供了在 Java 中启用 Ajax 的框架。两者都很成熟,并且没有浏览器不兼容的问题(ZK是基于jQuery的)。
然而,它们在架构上有很大不同。 GWT 是客户端方法——所有代码在客户端运行,而 ZK 服务器端方法——所有代码在服务器上运行(但它们可以选择在客户端编写一些应用程序代码)。所以,你的同事错了,你已经知道了——GWT 暴露了客户端的业务逻辑,而不是 ZK。
GWT(作为客户端方法)的优点是响应速度更快(如果设计得当,客户端-服务器请求会更少)。缺点是您必须在客户端和服务器之间进行所有数据封送(GWT RPC/JSON 仅支持非常简单的对象)。相比之下,ZK 的优点是你可以直接访问所有后端资源,不需要 RPC,不需要代理……此外,ZK 允许你在客户端编写一些代码来增强关键部分的响应能力(不幸的是,客户端代码必须是 JavaScript)。对我来说,这是最好的平衡。
GWT 的真正优势在于Google。我经常听到一些老板因为这个而将工程师推到 GWT。我也听说一些GWT项目失败了(主要是由于生产力问题造成的——如果项目复杂的话就太痛苦了),然后转向ZK。
GWT and ZK both provides a framework to enable Ajax in Java. Both are mature, and no browser incompatibility issue (ZK is based on jQuery).
However, they are very different architecturally. GWT is client-side approach -- all the code running at the client, while ZK server-side approach -- all the code running at the server (but they have an option to write some of application code at client). So, your colleague was wrong that you already know -- GWT exposed the business logic at client, not ZK.
The advantage of GWT (as a client-side approach) is faster responsiveness (less client-server requests if designed well). The disadvantage is that you have to do all the data marshaling between client and server (GWT RPC/JSON supports only very simple objects). In contrast, ZK's advantage is you can access all back-end resources straightforward, no RPC, no proxy... In addition, ZK allows you to write some code at the client-side to enhance the responsiveness of the critical parts (unfortunately, the client code has to be JavaScript). To me, it is the best balance.
The real advantage of GWT is Google. I kept hearing some boss pushed engineers to GWT because of this. I also heard some GWT projects failed (mostly caused by productivity issue -- too painful if the project is complicated), and then switched to ZK.
我从未使用过 ZK,但从它的外观来看,ZK 更适合“企业就绪”,因为它附带了许多现成的小部件。 GWT 最近才获得了类似 DataGrid 的控件。在 GWT 中重新创建 ZK 的日历或电子表格需要付出大量的努力。
你老板的“浏览器中业务逻辑太多”的说法确实表明他并不真正知道自己在说什么。 GWT 是一种仅客户端技术,而 ZK 看起来几乎完全是服务器端技术。
如果您还没有查看ZK 的 GWT 与 ZK 页面。他们似乎已经覆盖了大部分基地。
最后,请记住,你是编写程序的人,而不是他,如果老板强迫你做一些需要更多时间来实施的事情,那么相应地夸大你的估计。用管理层关心的事情来吸引他们要容易得多:“这项技术将使预算增加 X,进度增加 Y”,然后再提供技术细节。
I've never used ZK but from the looks of it, ZK is much more 'enterprise-ready' in the sense that it comes with a lot of ready-to-use widgets. GWT only just recently got a DataGrid-like control. Recreating ZK's Calendar or Spreadsheet in GWT would take a serious amount of effort.
You're boss's "too much business logic in the browser" statement really shows that he doesn't really know what he's talking about. GWT is a client-side only technology while ZK looks like it's almost completely server-side.
If you haven't already check out ZK's GWT vs. ZK page. They seem to have most of the bases covered.
Finally, remember that YOU are the one writing the program not him, if a boss forces something on you that will take more time to implement, then inflate your estimates accordingly. It's much easier to appeal to management with something they care about: "This technology will inflate the budget by X and schedule by Y" then with technical details.
请注意,ZK 的 GWT 与 ZK 页面 是由 Jeff Liu 编写的,他是Potix 公司的工程师。这是ZK的公司。
我也在 ZK 和 GWT 之间做出选择。我正在寻找最近一篇公正的文章来讨论两者,但尚未找到任何好的内容。
Please do note that the page ZK's GWT vs. ZK page is written by Jeff Liu, who is an engineer at Potix Corporation. Which is the company that made ZK.
I'm also struggling with making a choice between ZK and GWT. I'm looking for a recent unbiased article that discusses both but haven't been able to find anything good.
公司董事讨厌风险和不确定性。如果有很多开发人员都说某个框架很酷,而一位架构师却咬牙切齿地嘀咕着风险,那么他们就会一次又一次地反对。您需要获得该软件的第三方独立参考,即使使用开源也是可能的。
至少有一家公司出售 ZK 支持。他们会很乐意让您与使用过 ZK 的公司的架构师取得联系。向这些独立的第三方架构师询问一系列开放式问题,例如“您最喜欢什么、最不喜欢什么”、“您发现的主要挑战是什么”、“最令您惊讶的是什么”以及“其他框架做了什么”你考虑过,为什么选择ZK”。公司董事喜欢与其他公司的资深人士进行这种基于事实的研究。
同时设计一个“攻击课程页面”,它公平地代表了您必须在项目上构建的复杂性。让团队在 ZK 和 GWT 中实现该页面,并让每个人都尝试改进两者。以团队形式写下这段经历。一定要包括反对 ZK 的人,并且不要以对抗的方式这样做。不要陷入“他们对我们”或“她对我”的局面,而是将其作为一个开放的团队事实调查和培训活动,任何人都可以做出贡献。维基页面可能是一种理想的格式。
您将通过这种方法取得成功,因为 ZK 已被用于价值数百万美元的开发项目,其中团队超过 30 名开发人员,来自价值数十亿美元的全球金融公司。你们是最喜欢使用 ZK 的好公司之一。
Company directors hate risk and uncertainty. If there are many developers saying a framework is cool and one architect sucking through their teeth and muttering about risk then they are going to go with the naysay very single time. You need to get 3rd party independent references for the software which is possible even with opensource.
There is at least one company who sells support for ZK. They will be happy to put you into contact with architects at companies who have used ZK. Ask these independent third party architects a set of open ended questions such as "what did you most like and what did you most dislike" and "what was the main challenge you found" and "what most surprised you" and "what other frameworks did you consider and why did you pick ZK". Company directors love this sort of fact based research talking to senior people at other companies.
As the same time design an "assault course page" which is a fair representation of the sort of complexity you will have to build on the project. Have the team implement that page both in ZK and in GWT and have everyone try to improve both. Write up that experience as a team. Be sure to include the person who was against ZK and do not do this in an adversarial manner. Don't get into a them-vs-us or her-vs-me situation but keep it as an open team fact finding and training exercise where anyone can contribute to any bit. Wiki pages might be an ideal format for this.
You will have success with this approach as ZK has been used on multiple million dollar development projects with teams over thirty developers at billion dollar global financial corporations. You are amongst good company in preferring to use ZK.
如果您需要 ZK(服务器端 AJAX 框架)的优势,您可以将 GWT 与 SmartGWT 结合使用
If you need the advantages of ZK (server side AJAX framework) you can use GWT with SmartGWT
也许展示成功的企业级 ZK 应用程序会有所帮助。
当我第一次使用 IDempiere 2(ERP+CRM 软件)时,我的想法被震撼了。它是一个巨大的 ERP 软件,具有非常灵敏和干净的界面。
我用了不到一个小时就将它安装在 Windows 机器上。
Perhaps showcasing a successful enterprise level ZK application can help.
My mind was blown away the first time I worked with IDempiere 2 (the ERP+CRM software). It is a huge ERP software with a very responsive and clean interface.
I installed it on a windows machine in less than an hour.
ZK 更容易使用,并且 API 方面的学习曲线较低。另一方面,GWT 更难学习,而且体积更大,如果您想创建所有排列并且不使用适当的插件进行及时编译,则可能需要很长时间才能编译。不过,后者提供了更快的用户体验。如果您想快速为 Intranet 应用程序创建 GUI,请使用 ZK。如果您面向更多受众,请改用 GWT(GWT 中缺乏标准组件并不是真正的因素,因为您可以改用 GWT-ext,而另一方面,最重要的 ZK 组件是专有的)。
ZK is much easier to use and has a lower learning curve API-wise. GWT on the other hand is harder to learn and more bulky in the sense the it might take ages to compile if you want to create all the permutations and you don't use appropriate plugins for just in time compilation. The latter provides a much faster user experience though. Use ZK if you want to create GUIs for intranet applications fast. If you are addressed to a larger audience use GWT instead (the lack of standard components in GWT is not a real factor since you can use GWT-ext instead and on the other hand most essential ZK components are proprietary).