On Monday, May 14, 2012 9:48:14 PM UTC+2, Shaun Tarves wrote: > > I have an application utilizing A&P with an MVP set-up. There are some > situations where I want to create some self-contained widgets (think, a > small alert window that needs to fire and event or a box that might want to > pull some data from a server). They aren't whole views and don't occupy > entire display regions, but I want to maintain the MVP approach. > > I've seen a few approaches that include specifying a callback interface in > the widget that your presenters (the one driving the view that holds the > widget) would implement, but that would mean writing the same code multiple > times if you use the widget in more than one view. > > I'm curious what people are doing when faced with this situation.
If they're self-contained, why would your presenter need to do anything special with them? Can't they simply be implementation details of your views? As far as MVP is concerned, your self-contained widget could use MVP itself, it does not mean it has to be exposed and/or, if it is, the view should belong to the view of the containing component, and its presenter to the presenter of the containing component. As an example, CellList, CellTable, et al. use MVP internally, but they don't expose it; it's an implementation detail that allows fast (non-GWTTestCase) unit-testing of the algorithms. -- 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/-/Ffdgqf8sZeIJ. 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.
