我最近开始研究Google Web Toolkit。我已经完成了一些演练,我想我理解了基础知识和想法。但是,我对应用程序的整体架构和设计有一些疑问。
让我们从 GUI 开始。我想构建一个“通用”Web 应用程序,用户首先看到登录页面。成功登录后,用户将被重定向到某种索引页面并添加一个菜单。我为登录页面创建了一个新的 LoginComposite,并尝试使用 GWT Designer 设计一个漂亮的 HTML 表。但是,我发现这真的很难做到,因为您无法在各个单元格(TD)上设置任何单独的属性?无法指定 colspan 或 rowspan,并且我无法在单元格本身上设置任何填充或边距。简而言之,我确切地知道如何编写 HTML 代码,但我无法将其翻译给设计师。只有我这样吗?
另外,我想知道代码布局和设计的最佳实践。我浏览了 StockWatcher 教程,但这确实不是一个非常现实的 Web 应用程序。例如,我想知道应该如何设计不同的表单(每个表单都应该在继承 Composite 类的自己的类中)?我应该如何在表单之间切换(例如,首先是列表视图,然后是用于编辑列表中所选项目的表单,然后是完全不同的页面)?如果我为每个页面都有一个 Composite,并在需要时在 EntryPoint 中实例化它们,这是否意味着客户端将在页面加载时下载所有这些 Composite 的所有 JavaScript?我应该只使用一个 HTML 页面,还是应该有很多页面?
这些是任何 GWT 教程都没有真正涵盖的问题。如果有人知道使用 GWT 构建的“真实”Web 应用程序的好例子,我很乐意看到它。
感谢您的投入!
I have recently started studying Google Web Toolkit. I have went through some walkthroughs, and I think I understand the basics and the idea. However, I have some questions on the overall architecture and design of the applications.
Let's start with the GUI. I want to build a "common" web application, where the user first sees a login page. After successful login, the user is redirected to some kind of index page and a menu is added. I created a new LoginComposite for the login page, and tried to design a nice looking HTML table using the GWT Designer. However, I find that really hard to do, as you cannot set any individual properties on the individual cells (TDs)? There's no way to specify colspan or rowspan, and I can't set any padding or margin on the cells themselves. In short, I know exactly how I would have written the HTML code, but I can't translate that to the designer. Is that just me?
Also, I am wondering about the best practice for code layout and design. I went through the StockWatcher tutorial, but that's really not a very realistic web application. For example, I would like to know how I should design different forms (should each be in a own class inheriting the Composite-class)? How should I switch between forms (for example, first a list view, then a form for editing a chosen item from the list, then a totally different page)? If I have one Composite for each page, and instantiate them when needed in my EntryPoint, would that mean that the client will download all the JavaScript for all those Composites at page load? Should I stick with only one HTML page, or should I have many?
These are questions not really covered by any GWT tutorial. If anyone know a good example of a "real" web application built using GWT, I would love to see it.
Thanks for your input!
发布评论
评论(1)
Google IO 演讲中提供了大量资源。例如:
另外,如果您使用 GUI 构建 GWT 应用程序,则不要指望能够编辑所有内容。祝你好运!
There are a whole bunch of resources in Google IO talks. For example:
Also, don't expect to be able to edit absolutely everything if you are using the GUI to build your GWT app. Good luck!