Friday, September 13, 2013

Re: GWT Code Splitting : RPC issue

The problem is that when you use a generic type like Action then GWT will generate serializers for all implementations of Action and attaches this serializer information to the service. The first time you use the service, all data needs to be loaded.

Lets assume you have three logical modules that you want to code split: bootstrap, moduleA, moduleB where "bootstrap" contains the code to load your app.

What you need now are three service interface (one for each module) and three narrower action interfaces, e.g. for the bootstrap module:

interface BootstrapAction extends Action {}
interface BootstrapResponse extends Response {}

BootstrapDataService extends RemoteService {
  BootstrapResponse execute(BootstrapAction action)
}

All those interfaces (BootstrapDataService, ModuleADataService, etc.) can point to the same server servlet. 

So on the client you split up your command pattern into a command pattern per module with each module having its own action/response root interface.

-- J.

--
You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-web-toolkit+unsubscribe@googlegroups.com.
To post to this group, send email to google-web-toolkit@googlegroups.com.
Visit this group at http://groups.google.com/group/google-web-toolkit.
For more options, visit https://groups.google.com/groups/opt_out.

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home


Real Estate