开发者

GWT - Many widgets or a widget containing other widgets

开发者 https://www.devze.com 2022-12-21 01:45 出处:网络
I\'m designing the user interface. It h开发者_StackOverflowas some static content and a lot of widgets.

I'm designing the user interface. It h开发者_StackOverflowas some static content and a lot of widgets.

Which is better?

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


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.


i'm also working on project with a lot of widgets (maybe over 250) and i think, one widget, which contains all others is the better way.


How about a mix? If there are widgets that logically go together, group them into a containing widget. Then put a smaller collection of widgets into your big containing widget.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号