我应该使用哪个GWT EventBus?

编程入门 行业动态 更新时间:2024-10-08 02:18:15
本文介绍了我应该使用哪个GWT EventBus?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

在gwt-user.jar中有2个EventBus接口和SimpleEventBus插入。

In the gwt-user.jar there are 2 EventBus interfaces and SimpleEventBus implmentations.

com.google.gwt.event.shared。 EventBus 和 com.google.web.bindery.event.shared.EventBus 我将这些引用为gwt.event '和'web.bindery'。

com.google.gwt.event.shared.EventBus and com.google.web.bindery.event.shared.EventBus I'll refer to these as 'gwt.event' and 'web.bindery'.

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

Looking at the JavaDocs and source code I can see that the gwt.event merely wraps the web.bindery one. However the gwt.event implementation also hides a number of deprecated methods

那么我应该使用哪个实现? (我在GWT 2.4)

So which implementation should I use? (I'm on GWT 2.4)

推荐答案

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

Generally you should use the one in com.google.web.bindery. The only version used to be in com.google.gwt.event, but when RequestFactory and AutoBeans were moved out of GWT itself and into com.google.web.bindery so they could work in non-GWT clients.

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

If you use the com.google.web.bindery version in your presenters and such, it will make it easier to use outside GWT apps, should you need to. You'll also not get deprecation warnings when passing that instance to PlaceController and other classes that use EventBus.

更多推荐

我应该使用哪个GWT EventBus?

本文发布于:2023-11-28 21:48:28,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1644051.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:GWT   EventBus

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!