Nested Presenters Framework GWTP

August 8, 2010 at 9:40 pm Leave a comment

A complete model-view-presenter framework to simplify your next GWT project is GWTP.

As compared with with gwt-presenter , GWTP mainly is known for solving the nested presenters drawback where the child presenters get injected with the constructor:

Most web applications use a consistent layout across all their pages, sharing elements such as the header or a menu bar. In an MVP architecture this is achieved by nesting presenters into one another. In gwt-presenter, WidgetContainerPresenter is the base class for nested presenters. However, its implementation requires you to pass all the subpresenters within the constructor. This goes against the principle of weak coupling, and practically defeats the purpose of using an event bus. In contrast, GWTP is entirely built around the idea of nested presenters. Revealing a presenter triggers a precise string of events that ripples up to the parent presenters, lazily instantiating any presenter that is needed in the process. GWTP’s presenters also have a clearly defined lifecycle on which you can easily hook custom behaviors.

Presenter-Widget pairing

It uses a program that operates at the command line to easily download GWTP, and get the samples.

C:\> hg clone https://gwt-platform.googlecode.com/hg/ gwt-platform

C:\>hg clone https://samples.gwt-platform.googlecode.com/hg/ gwt-platform-samples

gwt-presenter Getting Started , TurboManage blog

Gwtpsample

MyGinjector::(DispatchAsyncModule,MyModule)

  • PlaceManager getPlaceManager();
  • EventBus getEventBus();
  • ProxyFailureHandler getProxyFailureHandler();
  • Provider<MainPagePresenter> getMainPagePresenter();
  • AsyncProvider<ResponsePresenter> getResponsePresenter();

 

MyPlaceManager extends PlaceManagerImpl

MainPagePresenter

Advertisements

Entry filed under: Uncategorized.

Stockwatcher GAE JPA History and Place

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Trackback this post  |  Subscribe to the comments via RSS Feed


@davidmbloom


%d bloggers like this: