在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?
发布评论