As i mentioned on SO, you should expose your api via a shared java jar file. That gives you reuse of code, and overheads on gwt are avoided.
As long as app1 and app 2 are completely different, the above approach works find. But if they are two pages on the same website, you are using gwt incorrectly. With gwt, you should keep a single module, and the use code splitting to optimize download size. On 5/26/10, kozura <[email protected]> wrote: > Have you looked at code splitting? I'm not sure exactly what you are > trying to accomplish, but this allows you to build an "in-house" app > with independent modules that depend on a core api, and only get > loaded on demand. It doesn't allow for externally created plugin > modules, as gwt requires a monolithic compile to do all of its code > optimizations. > > http://code.google.com/webtoolkit/doc/latest/DevGuideCodeSplitting.html > > On May 25, 4:27 pm, code prophecy <[email protected]> wrote: >> Hi, >> >> I have to make a web application using GWT and as per the propsed >> design, project has a core module that'll expose a set of apis to be >> used by other apps; each of these app are unrelated. Each shall be >> loaded in a separate iframe. >> >> My idea was to compile core into core.js and each app shall have its >> own app1.js app2.js and so on... >> Core should contain the gwt lib and the apis, each app should contain >> only the code relevant to itself i.e. no gwt-lib. >> >> App1 >> >> script type="text/javascript" src="core.js" ></script> >> script type="text/javascript" src="app1.js" ></script> >> >> with this design, due to browser caching, each app loads only the >> app.js which should be smaller ~20kb in size. >> >> Making a core module is straightforward but the apps are problematic. >> The reason being after compilation, each app contains the entire GWT >> library - this substantially increases the download size of the >> complete webapp. >> >> The option of compiling the code into a single monolithic js file is >> not possible as apps are to be designed based on apis exposed by the >> core, the way google gdata works (but in my case,along with api, even >> the core gwt-lib should be part of the core). >> >> Can anyone suggest a way to get aroung this problem ? I've checked >> similar questions on SO, but failed to find a simple working answer fr >> the problem. >> >> Thanks for any help. > > -- > You received this message because you are subscribed to the Google Groups > "Google Web Toolkit" group. > To post to this group, send email to [email protected]. > To unsubscribe from this group, send email to > [email protected]. > For more options, visit this group at > http://groups.google.com/group/google-web-toolkit?hl=en. > > -- Sent from my mobile device --Sri -- You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.
