简体   繁体   English

Wave的客户端GWT体系结构是什么

[英]What is client-side GWT architecture of Wave

I am wondering if some of you are aware of the architectural approaches taken by the Wave team to build its GWT web client? 我想知道你们中的某些人是否了解Wave团队用于构建其GWT Web客户端的体系结构方法? Since i am trying to optimize performance of one GWT app designed for mobiles, it is hard not to admire its speedy credentials :) 由于我正在尝试优化一款专为移动设备设计的GWT应用程序的性能,因此很难不钦佩其快速的凭证:)

  • Is Wave not using GWT-RPC to get regular updates from server? Wave是否不使用GWT-RPC从服务器获取常规更新? Firefox tracks some JSON communication going over the wire but nothing like RPC stuff. Firefox跟踪通过导线进行的JSON通信,但没有类似RPC的东西。

  • How do they proceed when, for instance a new wavelet is sent. 当例如发送新的小波时,它们如何进行。 Is there a view object for every wave DTO, or they use some other pattern? 每个wave DTO是否都有一个视图对象,还是使用其他模式?

  • How is GUI updated after a response with, say, a new Wave arrives. 在收到新的Wave响应后,如何更新GUI。 Would the whole area with wavelets being rerendered or the use some smart techniques to ensure that only particular element is touched? 是要重新渲染带有小波的整个区域,还是使用一些智能技术来确保仅触摸特定元素?

Thanks 谢谢

This is probably information overload, but since Google Wave is open source you can actually look at how they set things up here . 这可能是信息过载,但是由于Google Wave是开源的,因此您实际上可以在这里了解它们的设置方式。

If you look at WaveView.java, for example, you can see that they are using a client-side event bus like Ray Ryan mentioned in this talk at Google IO 2009. I seem to remember seeing another video where they talked about these aspects of Google Wave: 例如,如果您查看WaveView.java,您会发现他们使用的是客户端事件总线,例如Google IO 2009上的演讲中提到的Ray Ryan。我似乎还记得看过另一个视频,他们在其中谈论了这些方面。 Google Wave:

  • They use an event system to fire off events when something happens on the client side. 当客户端发生某些情况时,他们使用事件系统来触发事件。 The event system manages communication with the server, passing event information up to the server, getting events back from the server, and publishing those events that come back. 事件系统管理与服务器的通信,将事件信息传递到服务器,从服务器获取事件,并发布返回的事件。 The event bus uses a kind of buffer so that if a bunch of events are fired off in rapid succession, they can send them all in one batch. 事件总线使用一种缓冲区,因此,如果快速连续触发一堆事件,它们可以将它们全部分批发送。 For example, when a new Wave arrives, an event with the wave information would get fired, and any portions of the UI that are actively listening for that event would be notified, so that they could determine whether they needed to change themselves accordingly. 例如,当新的Wave到达时,将触发带有wave信息的事件,并且将通知UI的正在积极监听该事件的任何部分,以便他们可以确定是否需要相应地更改自己。
  • They used seam points (or some such; I can't remember the name) to make it so that GWT could break the code up into modules, and only load up the portions that actually need to be used. 他们使用接缝点(或类似的点;我不记得这个名字)来制作它,以便GWT可以将代码分解为模块,并仅加载实际需要使用的部分。 Since the wave ui javascript file was originally over 1MB (minified and compressed), that was pretty important. 由于wave ui javascript文件最初超过1MB(已缩小和压缩),因此非常重要。
  • Since only certain waves and wavelets would be visible at a time, they actually used some complex techniques to reuse the same DOM elements. 由于一次只能看到某些波形和小波,因此它们实际上使用了一些复杂的技术来重用相同的DOM元素。 So as you scroll down through your list of waves, it's actually taking the DOM element representing the wave at the top of your inbox, changing the information inside, and moving it to the bottom of your scroll area, leaving a blank space in the part of the scroll area that you're not seeing anymore. 因此,当您向下滚动浏览波形列表时,实际上是在表示收件箱顶部的波形的DOM元素,更改了内部信息,然后将其移动到滚动区域的底部,在零件中留有空白不再显示的滚动区域。

Additionally, I'm pretty sure they use something like Comet with JSONP to maintain continuous communication with the server, so they're not polling the server constantly for new updates, but rather there's a dynamically-generated javascript file that's being loaded in incrementally from the server, which contains instructions to fire whatever events the server has decided need to be fired. 另外,我很确定他们使用JSONP之类的Comet之类的东西来保持与服务器的持续通信,因此他们不会不断地轮询服务器以获取新的更新,而是有一个动态生成的javascript文件正在从中逐步加载服务器,其中包含用于触发服务器决定需要触发的任何事件的指令。

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

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