GWT Summary

EntryPoint interface void onModuleLoad()

RPC Service:
  – Service interface extending RemoteService
  – ServiceAsync Interface for SI with AsyncCallback<Output> as last param
  – ServiceImpl extending RemoteServiceServlet
           – DTO’s (DomainModel) to be returned by ServiceImpl
           – DTO (DomainModel) needs to be Serializable to be sent from server to client
           – define servlet paths for serviceImpl in web.xml
  – ServiceAsyncCallBack implementing AsyncCallback<T>
           –  implements methods onFailure(Throwable) & onSuccess(T)
           –  takes view as a constructor param and onSuccess paints the result (Presentation Model) on the view (dto (Domain) -> model (Presentation) ;          (Presentation) model -> view)
(Presentation) Model representing the UI data
           –  converts dto (DomainModel) to itself (Presentation Model)!
View representing the display screen/widgets – can take (Presentation) model as constructor param
EntryPointImpl hooks everything together
 – creates Async version of service using GWT.create(class)
 – creates the view and attaches handlers to widgets
 – handlers implement onClick(ClickEvent )  etc.,
 – handlers creates AsyncCallback, views and services (or obtains references to them) and invokes the Async service and passes the AsyncCallback created to handle the service response asynchronously.
*only ServiceImpl is in Server pkg.
*shared package is for classes shared between client and server
*note the difference between presentation model and domain model
Advertisements

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