> > whether view can pass Receiver into Activity. >
In both cases (Presenter.setReceiver(..) vs. View.setReceivedProxies(..) ) you will do the actual request in the activity. One difference between both is, that as soon as your activity has to calculate something based on the received data this calculation would go into the view if you choose Presenter.setReceiver(..) and implement the Receiver as anonymous inner class in the view. Now you need a slow GWTTestCase to test that calculation logic which is what we want to avoid by using MVP. If you want to use a fast JUnit test you could implement the Receiver as a concrete class (so the receiver can be used outside a view implementation), but in that case this concrete class needs a reference to the view interface which in turn must have setter methods (e.g. View.setReceivedProxies() ). Now you haven't really won anything because the setter methods could also be called directly by the activity. A second difference is that you dictate the used communication layer if you choose Presenter.setReceiver(..) and you use a RequestFactory Receiver. If you plan to change server communication you may also have to change your view (sure there are ways to avoid this, e.g. a general callback interface instead of the RequestFactory Receiver interface, but I guess it will make your code a bit ugly). So as Thomas said, use setter methods on your view interface to push data to the view (or use the editor framework). I do my stuff based on: http://code.google.com/intl/de-DE/webtoolkit/articles/mvp-architecture-2.html and it works great. In addition I dont use the term "Presenter" for the interface defined inside the view interface. I just call it "Delegate" because it simply only contains delegate methods that are called based on user input events (e.g. Delegate.createNewProxy() when the "New"-Button is clicked in the view). -- J. -- 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/-/zZryDuZVIScJ. 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.
