segment the code that declares the UI from the code that drives the UI.
GWT Best Practices - DevNexus 2010 - 0 views
Large scale application development and MVP - Part II - 0 views
-
-
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...
GWT & MVP - Google Web Toolkit | Google Groups - 3 views
-
the MVP pattern has nothing in common with GWT's Place/History management framework (often referred to as GWT MVP). If you use GWT places/activities your app will gain bookmarkable urls that represent a place/application state and whenever such a url is visited a corresponding activity will be started. This activity is then responsible for attaching some UI/widgets to an area of your webpage. If this UI is complex and has user interaction elements then you could implement this UI with the MVP pattern to separate the UI from the logic that will be performed when the user interacts with this UI. And once you decide to use the MVP pattern then its in most cases easier to let the activity be the presenter. But its also possible to implement a separate presenter and let the activity hold a reference to it.
‹ Previous
21 - 31 of 31
Showing 20▼ items per page