Example of GWT project using Activities and Places
App
Manifest - Specify's MyApp.java as the EntryPoint to the application.
MyApp.java - Implements EntryPoint defining the onModuleLoad method which will start the application.
Model
- Responsible for holding raw data
- This shouldn't contain any business logic.
View
- Resonsible for displaying data
- Allows UiBinder to pass through UiHandler methods to the Presenter
PersonView.java - Interface to define a PersonView.
PeronViewImpl.java - Implementation of a PersonView. This shouldn't contain any business logic.
PersonViewImpl.ui.xml - Template that can contain either HTML or GWT Widgets.
ClientFactory
- Holds on to instances of views and other reusable system resources
Activity
- Presenter with "bells and whistles".
- Has lifecycle events - navigated away, activity's widget (view it controls) is removed from view, etc
- Implements the Presenter interface defined in the view above
Place
- Most Activities have an associated Place
- Extends Place
- Usually has a Tokenizer defined as an inner public class
- Implements PlaceTokenizer
PlaceHistoryMapper
- A way to let GWT know about your history tokenizers
- Link between PlaceTokenizers and GWT's history mechanism (PlaceHistory_Handler_)
ActivityMapper
- A way to map each Place to some Activity. Remember that Activity implements presenter so an Activity is a Presenter
- Used to automatically route app to an Activity