RestyGWT 与 RequestFactory

发布于 2024-12-17 18:56:44 字数 589 浏览 0 评论 0原文

我正在考虑将当前基于 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 技术交流群。

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

发布评论

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

评论(1

笔芯 2024-12-24 18:56:44

尽管我们目前正在使用 RequestFactory,但我建议使用 REST。
以下是 3 个主要原因:

  1. 客户端和服务器实现不必相互依赖(如果您计划在非 Android 设备上使用本机应用程序,则不要忘记 requestfactory)。
  2. requestfactory 中的新 api 更改会破坏旧的客户端代码(这会对生产造成毁灭性的结果),
  3. REST 生态系统和社区更大,更容易解决代码中的问题,并允许其他应用程序将来与您的应用程序进行通信。

Although we are currently working with RequestFactory, I'm recommending REST.
These are the 3 main reasons why:

  1. client and server implementations don't have to be dependent (if you ever plan on native apps for a non android device than forget about requestfactory).
  2. new api changes in requestfactory break old client code (this has devastating results on production)
  3. the REST eco system and communities are larger and it is easier to tackle issues in code, and allow other apps to communicate with yours in the future.
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文