Search code examples
javagwtgwt-platform

Package Organization in GWT(P)


I recently discovered GWT-Platform (GWTP) and am loving the architecture.

However, I'm finding that my packages easily get pretty bloated with classes (as three separate classes are generated with every Presenter you create, etc.). Of course, this can be a problem in any MVP GWT framework.

What do you recommend for organizing packages in GWT? I'm having a hard time finding logical places to segment my Presenters/Views/Events/Actions.

I've currently got something like the following, but I'm finding that I'm still getting dozens of classes in each sub-package which is difficult to navigate.

  • client.presenters - stores all presenters
  • client.views - stores all views
  • client.uibinder - stores all UI binder classes

Solution

  • Assume Package structure of GWTP project as below:
    ->Client package
    com.gwtplatform.hplace.client
    
    ->Gin configuration package
    com.gwtplatform.hplace.client.gin
    
    Contain classes:
    ClientGinjector
    ClientModule
    
    ->Uibinder/View classes package
    com.gwtplatform.hplace.client.view
    file.java
    file.ui.xml
    
    ->Presenter class package
    com.gwtplatform.hplace.client.presenter
    
    ->Guice/Server package:
    com.gwtplatform.hplace.server.guice
    
    ->Shared package
    com.gwtplatform.hplace.shared