开发者

Avoid anonymous inner classes in GWT command pattern

开发者 https://www.devze.com 2023-02-22 12:30 出处:网络
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 cod

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.

0

精彩评论

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