RestyGWT 与 RequestFactory
我正在考虑将当前基于 GWT-RPC 的服务层迁移到其他层。它大约有 10 个服务接口,每个接口有 5 个方法,涉及大约 20 个不同的域实体,因此您可以了解更改整个事物所需的工作量,显然我希望将其最小化。我还使用 Gilead 和基于 Guice 的集中式 Servlet 来处理所有 RPC 请求。
更改的主要原因是:
- TypeSerializer 消耗了应用程序代码大小的最大部分。
- 客户端的序列化/反序列化速度很慢,特别是在开发模式下,这似乎是 GWT-RPC 的一个普遍事实。
- 显然我想最小化在线有效负载,但这不是硬性要求。
我正在考虑的选项是:
RequestFactory,它被提升为更快的野兽。但我担心将域对象的客户端代码中的所有引用替换为其代理对应项会需要大量工作,而且我也懒得实际构建所有代理。
使用 RestyGWT 的完整 JSON/REST 方法,看起来它仍然可以让我使用域对象,但我担心它最终会导致反序列化速度更慢?我没有基于任何事实,但找不到任何基准。这只是一个印象。
我真的很想得到建议。
谢谢!
I'm thinking on migrating my current service layer based on GWT-RPC to something else. It is about 10 service interfaces with 5 methods each, and involving about 20 different domain entities, so you have an idea of the amount of work that would require to change the whole thing, which obviously I would like to minimize. I'm also using Gilead and a Guice based centralized Servlet to handle all the RPC requests.
The main reasons for the change are:
- TypeSerializers are consuming the most big part of the size of the app code.
- Serialization/deserialization on client side is SLOW specially on dev mode, which seems to be a common fact with GWT-RPC.
- Obviously I would like to minimize the on-wire payload, but is not a hard requirement.
The options that I'm thinking about are:
RequestFactory, which is promoted as a faster beast. But I'm afraid that it would be a lot of work to replace all references in client code of domain objects to their proxy counterparts, and also I'm lazy to actually build all the the proxies.
A full JSON/REST approach using RestyGWT, which looks like it would let me still use the domain objects, but I'm afraid that it would end up with an even slower deserialization? I'm not based on any fact, but couldn't find any kind of benchmark. It is just an impression.
I really would like to get suggestions.
Thanks!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
尽管我们目前正在使用 RequestFactory,但我建议使用 REST。
以下是 3 个主要原因:
Although we are currently working with RequestFactory, I'm recommending REST.
These are the 3 main reasons why: