Skip to content

GWT Integration patterns

apetrelli edited this page May 3, 2013 · 2 revisions

GWT Integration has a set of libraries to help writing patterned objects.

Deletable concept

The gwt-integration-deletable library has the "deletable" interface, that every entity that is used with DeletableLocator of gwt-integration-web-deletable should implement.

To help this process, if you are using JPA you can extend AbstractDeletable of gwt-integration-jpa and you can use DeleteEntityListener to mark objects as deleted:

@Entity
@EntityListeners({ DeleteEntityListener.class })
public class Person extends AbstractDeletable {
...
}

Model-View-Presenter patterns

The gwt-integration-mvp library has some patterns that helps to write MVP-related classes:

  • MvpView: every view widget that is used as a "subpage" should implement this. The AbstractMvpView has a simple basic implementation.
  • MvpView.Presenter: every basic activity/presenter should implement this interface. The AbstractPresenter class is a basic implementation.
  • HasBody should mark a widget that acts as a template, with a widget that serves as the "body" of a page and that changes when the place change.

Service patterns

The gwt-integration-service has some patterns to deal with server-side services.

  • CrudService is an interface that marks a service that makes basic CRUD operations. It is usually used together with CrudRequest of gwt-integration-editor.
  • SearchService is an interface that marks a service that makes a search operation with a filter. It is usually used together with SearchRequest of gwt-integration-editor.