Search code examples
gwtwidget

GWT - Many widgets or a widget containing other widgets


I'm designing the user interface. It has some static content and a lot of widgets.

Which is better?

  • HTML with a widget containing the other widgets
  • HTML containing all widgets

Solution

  • I addressed this very question in a presentation to a local JUG meeting the other day.

    Which is better depends on what problem(s) you are trying to solve. Usually that means what pain you are trying to avoid from previous projects.

    If you find it to be painful to include the static content in your GWT Module code, then your second option looks more appropriate. If the different widgets need to interact with each other (e.g. updating one refreshes the others), then your first option will contain the less pain.

    Do you like the declarative style of GUI generation? If so, then consider using UiBinder which is included in GWT 2.