gpt4 book ai didi

java - 我应该使用哪个 GWT EventBus?

转载 作者:IT老高 更新时间:2023-10-28 20:53:04 24 4
gpt4 key购买 nike

在 gwt-user.jar 中有 2 个 EventBus 接口(interface)和 SimpleEventBus 实现。

com.google.gwt.event.shared.EventBuscom.google.web.bindery.event.shared.EventBus我将它们称为“gwt.event”和“web.bindery”。

查看 JavaDocs 和源代码,我可以看到 gwt.event 只是包装了 web.bindery 之一。然而 gwt.event 实现也隐藏了一些不推荐使用的方法

那么我应该使用哪种实现方式? (我在 GWT 2.4 上)

最佳答案

一般你应该使用 com.google.web.bindery 中的那个。唯一的版本曾经在 com.google.gwt.event 中,但是当 RequestFactory 和 AutoBeans 被移出 GWT 本身并进入 com.google.web.bindery 时,所以他们可以在非 GWT 客户端中工作。

如果您在演示者等中使用 com.google.web.bindery 版本,则可以在需要时更轻松地使用外部 GWT 应用程序。将该实例传递给 PlaceController 和其他使用 EventBus 的类时,您也不会收到弃用警告。

关于java - 我应该使用哪个 GWT EventBus?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8947726/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com