GWT - 它应该只用于动态部分吗? [英] GWT - should it really only be used for the dynamic parts?

查看:73
本文介绍了GWT - 它应该只用于动态部分吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在2009年有关GWT缺点和专业人士的一些StackOverflow问题上,回答


[...]使用gwt只填写应用程序的动态部分。所以如果你有很多领域的复杂的用户交互。但是,请勿使用随附的面板。拿你现有的股票设计师提供的页面。挖掘出将包含您的应用程序控件的区域。将这些控件附加到onModuleLoad()中的页面上。这样,您可以使用设计师的标准页面,也可以在gwt之外完成所有样式。


好的,我正在尝试找出背后的原因。如果我理解正确,客户端会收到一个编译好的HTML和JavaScript文件。因此,从浏览器的角度来看,他是不是应该忘记HTML页面的创建方式(通过静态编辑HTML页面或通过GWT代码动态地)?此外,看起来GWT面板被翻译成编译页面上的简单HTML元素。那么性能在哪里出现?

解决方案

尝试想象您的应用程序有5000个不同的复杂独特页面。如果你试图使用GWT来实现它,你将在开发过程中遇到一个相当大的问题,因为编译时间会很长,并且devmode也会很慢。有时候最好在GWT中实现所有内容,有时最好将静态页面与GWT结合起来。

基本上你必须使用GWT才能为用户带来真正的好处。如果用户无法看到差异,如果页面是静态或动态的,请使用最容易使用的技术。例如,如果您正在开发Web图像编辑器,GWT是一个明显的选择。如果你正在创建一些维基百科克隆,你应该使用GWT主要用于一些动态部分,如管理,搜索和编辑。


On some StackOverflow question about GWT cons and pros from 2009 someone answered that:

[...] Use gwt to only fill in the dynamic parts of your apps. So if you have some complex user interactions with lots of fields. However, don't use the panels that come with it. Take your existing stock designer supplied pages. Carve out the areas that will contain the controls for your app. Attach these controls to the page within onModuleLoad(). This way you can use the standard pages from your designer and also do all the styling outside the gwt.

Well, I'm trying to figure the reason behind it. If I understand correctly, the client receives a compiled HTML and JavaScript files. So, from the browser perspective, isn't he supposed to be oblivious to the way the HTML page was created (statically by editing the HTML page or dynamically by GWT code)? Also, it appears that the GWT panels are translated into simple HTML elements on the compiled page. So where is the performance hit here?

解决方案

Try to imagine that your app have 5000 different complex unique pages. If you try to implement it all using GWT, you will have quite a big problem during development, because compilation time will be very long and devmode will be slow as well. Sometimes it is better to implement everything in GWT, sometimes it is better to combine static pages with GWT.

Basically you have to use GWT when it will bring some real benefits to the user. If user won't be able to see difference, if page is static or dynamic, use the technology which is easiest to use for you. For example if you are developing web image editor, GWT is an obvious choice. If you are creating some Wikipedia clone, you should use GWT mostly for some dynamic parts, like administration, search and editing.

这篇关于GWT - 它应该只用于动态部分吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆