Search code examples
gwtguicemodularitygwt-gin

Dynamic GWT Modules with Guice and GIN in execution time


Me and one friend are thinking in build a pluggable applications with GWT, guice, GIN, JPA2 etc...

In our idea, we will have a basic web app, with login, permission management, basic configurations, a menu and a content slot for the real webapp content.

Then, we can build a new Plugin using some API provided by the web app, gen a jar file, and put it inside a folder in the web app. Then, when the app start, with reflection we will detect what modules are declared and add them to the Injector and to the classpath. That could work in server side code.

But, We couldn't think in something really good and usable for client side, because the GWT code are compiled, so, we cannot just add new places, events etc without inherit the module and/or recompile the app...

So, in this question, I will like to hear what you folks, think that could be done to make it works. Any idea would be welcome.

Thanks in advance.


Solution

  • This is just and idea more than an answer:

    I understand you end up with several applications (several modules .gwt.xml), each one with its entry point. Then you have an agreggator module with some of the other modules. So you have to recompile every time this agregattor module which in fact recompiles all the classes from the other modules. This is the prefered way because you keep your application consistance.

    Another way I am thinking (not tried it) is to have apis, service interfaces and objects in a Common module and then your agreggator will be a simple html page with some js code to glue all the modules. So, if you don't change your Common module you will not need to recompile the other modules.

    Quite difficult tough.

    Maybe this can help. http://www.summa-tech.com/blog/2011/02/22/structuring-gwt-modules-for-large-applications/