user506259
user506259

Reputation: 601

Modularizing GWT application

There is GWT application which contains many small applications inside it. Once compiled, these modules are already loaded on demand, but as the applications grows bigger, there is also a need to somehow select desired modules before compiling or before starting GWT hosted mode.

Does anyone know, which are the possible ways to achieve this goal?

Upvotes: 2

Views: 623

Answers (1)

Jama A.
Jama A.

Reputation: 16109

If you want to divide your one big module into different modules. Firstly, you should divide them logically. For example, in my case Document Management, Project Management, CRM and also consider having one Core module which keeps your utils and/or general classes for all modules. And then, your every module should have separate EntryPoints which cross the main EntryPoint in your Core module. This main EntryPoint controls dispatching to the right module. For instance in your Core.gwt.xml

<module>
   <inherits name='com.google.gwt.http.HTTP'/>
    <inherits name="com.google.gwt.user.User"/>
    <inherits name="com.google.gwt.i18n.I18N"/>
</module> 

and in your pm.gwt.xml you just inherit the core module.

<module rename-to="pm">
    <inherits name="com.company.gwt.core.Core"/>
    <entry-point class='com.company.gwt.pm.client.PMEntryPoint'/>
</module> 

Another tip is: read about code splitting, If you have large application you must use it otherwise, the entire application (i.e.javascript bundle) is downloaded in one chunk on the initial load of the application.Besides that you can get the results of your compiled output by using this tool.

Upvotes: 2

Related Questions