Comment by adam.tacy:
A suggestion for the common coding patterns: I've found that I needed three
cases more often than not and so extended the ModuleClient? interface as
follows:
{{{
public interface ModuleClient {
void onLoad(Module instance);
void onAlreadyLoaded(Module instance);
void onUnavailable();
}
}}}
The addition is the onAlreadyLoaded() method which can be used if the code
is already loaded. This is useful if you want to do additional work on the
first load and only a subset or different work if already loaded.
A very simple example is where the RunAsync code might return a widget. The
onLoad() could add that widget to the DOM and then configure some items on
it, the onAlreadyLoaded() method may not want to add the widget to the DOM
and only show it.
For more information:
http://code.google.com/p/google-web-toolkit/wiki/CodeSplitting
--~--~---------~--~----~------------~-------~--~----~
http://groups.google.com/group/Google-Web-Toolkit-Contributors
-~----------~----~----~----~------~----~------~--~---