tags:

views:

651

answers:

2

Hello there,

I am struggling in getting the structure of my GWT application right. (Am I the only one one who finds that GWT code very easily ends up very messy and unreadable?)

The application is supposed to be an interface to a couple of quite distinct areas - let us say area A and B. At the moment I am trying to implement it as an interface with two tabs - one taking you to area A and one taking you to area B. I do not see how I can have a nice separation of the code needed for the two different areas in this way though - applying the MVP pattern (which I actually do not find thaaaat clear how to do in a case of a hierarchic interface like my tabs) I end up having area A and area B code in for instance both the client.view and the client.presenter package:

src
 - main
     - java
         - client
             + event
             - presenter
                 + a_stuff
                 + b_stuff
             - view
                 + a_stuff
                 + b_stuff
 :

I have not been able to find some good examples of how and when to use multiple modules - and am wondering if my case might be one where multiple modules would make sense? How would the code be structured in that case?

Maybe it is relevant to mention that I am using the latest GWT. And maven and IntelliJ IDEA.

Hints would be greatly appreciated, thanks a lot from Stine :)

A: 

I suggest something like this:

src
 - main
     - java
         + a_stuff
           -client
             - presenter
             - view
             - event
         + b_stuff
           -client
             - presenter
             - view
             - event
Aito
Sorry if I am a bit slow here! But does that result in two modules?
Stine
No, for that you need two module files: http://code.google.com/webtoolkit/doc/latest/DevGuideOrganizingProjects.html#DevGuideModuleXml - see section "Dividing code into multiple modules"
Igor Klimer
Yes, I know that each module takes a gwt.xml :) What I meant (I guess) was if code can be put into the above structure and still be part of the same module. If it implies two modules I might have a bit of a problem understanding what happens to all the html, css, and images I have in my webapps folder. Gosh, I would just love to see a thorough example! >D well, guess I should start by taking a look at the section you suggest - for some reason I have missed that one! ;) Thank you..
Stine
A: 

Have a look at mvp4g

http://code.google.com/p/mvp4g/wiki/MultiModules

Brian Boyle
Thank you.. I will take a look :)
Stine