在 GWT 中设计 GUI 的最佳实践

发布于 2024-11-19 11:29:56 字数 740 浏览 2 评论 0 原文

我最近开始研究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!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

情仇皆在手 2024-11-26 11:29:56
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文