We use GWT.runAsync to separate pieces of code that users might not need to see. When it's time to load the user interface, we just check what they need and then display it.
We distracted most of the necessary business logic in the settings that we load for each user, for example, "showTeacherControls" and "showAdvisorControls" and "showStudentControls". The client can then simply check these flags to figure out what to display.
source share