There are a few things that you should keep in mind before you try to understand the MVP pattern 1. You don't have reflection or observer/observable pattern on the client side. 2. Views depend on DOM and GWT UI Libraries, and are difficult to mock/emulate in a pure java test case Now, to answer some of your questions
Feedback on "Large scale app development MVP article" - Google Web Toolkit | Google Groups - 0 views
-
There are a few things that you should keep in mind before you try to understand the MVP pattern 1. You don't have reflection or observer/observable pattern on the client side. 2. Views depend on DOM and GWT UI Libraries, and are difficult to mock/emulate in a pure java test case Now, to answer some of your questions
Issue 5275 - google-web-toolkit - All widgets should implement some kind of interface f... - 0 views
-
if your concern is testing your presenter, then how about changing your MVP from the "Passive View" pattern (the one showed by Ray Ryan at I/0 2009) to the "Supervising Controller" pattern (the one used by Cell widgets internally and by applications generated by Spring Roo): http://martinfowler.com/eaaDev/uiArchs.html Sure you test a bit less things as you leave more of the logic into the view than with a "Passive View", but in my experience it also makes tests much more easier to write and more readable, as you need far less mocks and stubs (no MockButton, MockTextBox, etc. only a MockView).
Large scale application development and MVP - Part II - 0 views
-
segment the code that declares the UI from the code that drives the UI.
-
we want the our ContactsPresenter to implement a Presenter interface that allows our ContactsView to callback into the presenter when it receives a click, select or other event. The Presenter interface defines the following: public interface Presenter<T> { void onAddButtonClicked(); void onDeleteButtonClicked(); void onItemClicked(T clickedItem); void onItemSelected(T selectedItem); }
-
The first part of wiring everything up is to have our ContactsPresenter implement the Presenter interface, and then register itself with the underlying view. To register itself, we'll need our ContactsView to expose a setPresenter() method: private Presenter<T> presenter; public void setPresenter(Presenter<T> presenter) { this.presenter = presenter; }
- ...8 more annotations...
1 - 5 of 5
Showing 20▼ items per page