views:

210

answers:

2

Hi:

I m trying to find the best way to build my UI based on whos logged in. The scenario is, there are (at the moment) 2 types of user normal and super-user the super-user will normally see more controls than a normal user

I was gonna do some heavy inheritance, ie create by default SomeDialog or if super-user is logged instanciate SomeDialogSuper instead, however I have some concerns:

  • I find that with gwt-ext when doing a lot of inheritance you need to create a lot of panel when you are going to inject things at a later stage.
  • The multiple SomeDialog and then SomeDialogSuper sound like a bad idea and a nighthmare to maintain

Then I though well I could use some convention so I don't have to worry too much about which control is instantiate but I m not terribly sure how to do this

Any pointers ?

+1  A: 

We store GUI layouts in XML "page" files stored on the server which makes requirements like yours easy to handle (use "normal_user.xml" or "superuser.xml"). The page files are marshaled into a tree of serializable factory/DTO instances that are used to create the actual widgets on the client side.

We have built a large HR portal on a framework that uses this approach. That framework is now open source. Have a look at GWT Portlets.

David Tinker
Like this, and really appreciate the fact its open source having a good look at this now.
Miau