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:
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 ?
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.