On 13 juil, 11:18, Kwhit <kwhitting...@gmail.com> wrote: > I'm following your work with interest Eduardo, I'm in the process of > building a 'dream-team reference application' myself including RPC, > EasyMock, GIN, Guice, ... so I can unit test and hack end-to-end > without deploying on a server. > > Here's question / comment... > > I don't understand the go() method on the presenter impl classes. Take > for example mainPresenter.go(): it does a bit of widget composition > adding the menu and returns the view which is the job of getView(). > Then in go() you call menuPresenter.showMenu() which doesn't actually > show the menu but instead it returns the view which is again the job > of MenuPresenterImpl.getView(). > > My guess is you are (like me) having some problems in the last metre > of the 100m just glueing the application together. I don't have a nice > answer for that yet...
Just a thought: how about building *some of* the "view hierarchy" via DI too and inject the very same views (widgets) in both their parent widget (for "view compositing") and presenter? (only in the case of singletons of course, and use providers and/or these getView/getWidget methods we've talked about otherwise). E.g. in Eduardo's sample: inject a MenuWidget instance into both the MainWidget constructor and the MenuPresenterImpl (MenuWidget is laid out by MainWidget and controlled by MenuPresenterImpl); and in the case of the IssueDisplayXXX and IssueEditXXX, use providers as of today for lazy-init (inject Provider<IssueDisplayWidget> and Provider<IssueEditWidget> into MainWidget), but use singletons though, so that the view and presenter are correctly associated while still using two distinct, unrelated providers. And only in those cases where you need several instances of a component (presenter/view) you'd have to use the getView/getWidget methods so that you get/create a presenter instance from the Ginjector which gets injected its own view. It's just an idea, feel free to reject it with whichever argument comes to your mind ;-) --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---