Hi! We are using GIN in our application which is constructed in MVP style. We tried to follow some best practices described in GWT pages and here in GWT group so we design the application in the following manner: 1) We have multiple main screens(pages) that have activities attached to them. They are build in MVP style where presenters are also activities. 2) Every main screen is a collection of some sub-widgets which can also be created from some other sub-sub-widgets, so you can say that we are nesting views and their presenters. 3) The main views are singletons. Our sub-widgets are not singletons because we are reusing them. 4) All of our presenters aren't singletons. 5) They are created using GIN
GIN Binding example: bind(SubWidgetView.class).to(SubWidget.class); bind(MainWidgetView.class).to(MainWidget.class).in(Singleton.class); Injecting sub-widget into main widget through constructor example: @Inject public MainWidget(SubWidget widget1) Injecting sub-widget's interface into presenter through constructor example: @Inject public SubWidgetPresenter(SubWidgetView widget1) The problem is that we get two objects of the sub-widget class, one for injecting the into main widget and the other one for while injecting into it's presenter. The first one is shown on the screen but the other one is bind to the presenter. When presenter changes its view, it changes the view that was not bin to the main widget and we can't see anything. So our solution would be to create one sub-widget per main-widget but we don't know how to do it and if we do, we don't know how to inject that object of the sub-widget into the recreating presenter. Marko -- You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group. To post to this group, send email to google-web-toolkit@googlegroups.com. To unsubscribe from this group, send email to google-web-toolkit+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.