I use GWT-dispatcher for my GWT-app to get the benefits of command-pattern. As the number of server calls grows the number of anony开发者_如何学Pythonmous inner classes also grows and clutters the code. Is there a design tip on how to extract these anonymous inner classes and their onSuccess and onFailure from the rest of the code (in my case the Activity)?
You can declare named inner classes instead. These classes can even be static if they don't need to access the instance of the outer class, though this is not important for code to be compiled by GWT.
精彩评论