On Wednesday, September 12, 2012 6:04:04 PM UTC+2, BM wrote: > > Hi Jens, > Thanks for replying back with an example. You answered what I am needing > for. So that definitely helps. I kind of thought about this approach but > couple of things I found here which I am not sure is better way to do that. > > 1) My presenter would need additional dependencies like ClientFactory, > EventBus. That means my MyCustomWidget need to have ClientFactory, EventBus > so that I can pass them to the Presenter. Considering we want to make our > MVP Views as dumb as possible and have only GWT widget code inside is this > okay to include ClientFactory, EventBus in your View class now? >
Why not? (that wouldn't be my preferred approach if you ask me) > 2) If you see the classic GWT MVP view, Place instantiates an Activity > class passing ClientFactory in it's constructor and Activity class start > method uses ClientFactory to get the view and assign itself inside the view > as it's presenter. Whereas your way is opposite where your Composite View > class is instantiating Activity through it's constructor and passing itself > to the Presenter. > Yes. FYI, CellTable, CellList, etc. use MVP internally, with the view constructing the presenter (simplifying a bit), as Jens suggested. 3) If I am referencing this Custom Composite View MyCustomWidget in another > Ui Binder View how do I pass ClientFactory, EventBus to this MyCustomWidget > using UIBinder? That means I have to pass ClientFactory, EventBus to every > Parent View so that it can get passed to the MyCustomWidget if that view > is using it. This kind of differs to existing Activities & Places framework > where MVP View doesn't hold ClientFactory, EventBus objects but it's > Activity class do. > > What do you think? >> >> >> When you have such external dependencies, it's clear that these components are not "just widgets". In that case, I'd rather follow the Wave way: "parent view" creates the "child view", "parent presenter" creates the "child presenter" giving it its "child view" retrieved from the "parent view". See http://www.google.com/events/io/2010/sessions/gwt-continuous-build-testing.html -- You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group. To view this discussion on the web visit https://groups.google.com/d/msg/google-web-toolkit/-/RaNgbJTSTSAJ. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.
