the "MyModule" that will be used in MyModuleUsage module does not need to be GWT compiled ... and even further you can't GWTcomplie it without an entry point, but you don't need it gwt complied, in this type of scenario myModule is compiled in java (javac) and made a jar that has the .class files along with the .java files for the classes in the (from the) folder that are mentioned by <source path='client'/> tags.
when you'll GWTcompile the MyModuleUsage module GWT il put in that compilation all the classes needed for this module to run that includes the classes from MyModule. that in info is on AFAIK bases, if someone knows different please correct me. for "My question is , the way I am using multiple modules to reduce files sizes, is it correct or no ?" only the people working on developing GWT could give u an correct answer, my guess is that it' wont reduce it. but it would be usefull if you've used MyModule in other more modules like MyModuleUsage Hope it helps you and clears some of you questions good luck On Feb 19, 7:28 am, vinayak <vinayakshu...@gmail.com> wrote: > Moderators, > Nobody is answering this question. Is it that > others can not view this thread anywhere? Do I need to do something > more to make it viewable to others ? > Question must be easily answerable.... Please help. > Thanks. > > - vinayak > > On Feb 17, 11:17 am, vinayak <vinayakshu...@gmail.com> wrote: > > > > > Hello, > > I am a newbie to GWT and using gwt 2.0 and now gwt 2.0.2 to > > create my web application. (Actually I am converting my existing app > > to a gwt app...). To do this I am trying one small example. To avoid > > very large .no-cache.js file and large first page Ioad time, I have > > created 1 module (e.g. MyModule) and I am using it in my main gwt > > project by inheriting it. My main project name is MyModuleUsage. > > > Here is the code in MyModule. This has no entrypoint class. It has one > > MyForm class, one DetailsService and .gwt.xml file. (given below) > > > public class MyForm extends Composite { > > // Code to create my form > > > } > > > MyModule.xml: > > > <?xml version="1.0" encoding="UTF-8"?> > > <module rename-to='mymodule'> > > <inherits name='com.google.gwt.user.User'/> > > <source path='client'/> > > </module> > > > After creating this module, I created MyModule.jar with src and class > > files as described on > > >http://developerlife.com/tutorials/?p=229 (Although it was for > > gwt1.4 and IDEA, I could use that info on gwt 2.0 and eclipse.) > > > I created MyModule.jar manually by copying src and class files in > > required dir structure. ( I hope there is some utility of gwt itself > > to create one...please let me know if any) > > > Code for MyModuleUsage is as given below. > > > public class MyModuleUsage implements EntryPoint { > > > public void onModuleLoad() { > > // My buttons and textboxes and tables.... > > MyForm myform = new > > MyForm(); // This is from inherited > > module. > > RootPanel.get("MyMod").add(myform.asWidget()); > > // some more buttons...and their click handlers.. > > > } > > > MyModuleUsage.gwt.xml > > > <?xml version="1.0" encoding="UTF-8"?> > > <module rename-to='mymoduleusage'> > > <inherits name='com.google.gwt.user.User'/> > > <inherits name='com.mycompany.my.MyModule'/> > > <inherits name='com.google.gwt.user.theme.standard.Standard'/> > > <entry-point class='com.mycomany.your.client.MyModuleUsage'/> > > <source path='client'/> > > <source path='shared'/> > > </module> > > > There is one more service of this project itself to handle clicks of > > buttons created inside MyModuleUsage.. > > > Now if I run MyModuleUsage then I get required output. Click on > > buttons of Myform are handled by service inside MyModule and click on > > buttons of MyModuleUsage are handled by service inside MyModuleUsage > > as expected. This gives me a feeling that I can use MyModule as > > indepedent component which I can use any other gwt project. > > > If I do a gwtcompilationof MyModuleUsage in eclipse then generated > > no-cache.js file is of 6 kb and cache.html file is of 80 kb. > > > If I write code to generate same UI and service inside a single module > > then generated no-cache.js file is of 10 kb and cache.html file is of > > 230 kb. > > > My question is , the way I am using multiple modules to reduce files > > sizes, is it correct or no ? > > Second I have never gwt compiled MyModule independently. so when > > exactly it gets compiled ? > > where are the compiled files for MyModule.- Hide quoted text - > > - Show quoted text - -- You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group. To post to this group, send email to google-web-tool...@googlegroups.com. To unsubscribe from this group, send email to google-web-toolkit+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.