Putting the patch aside for a moment, I think the Wave team solved this
problem best: allow the view to have knowledge of its controller, but in
its own terms, via a delegate interface that the view defines. The
little bit of code you wind up with in most views becomes a semantic
passthrough to the delegate.
interface FooView {
interface Delegate {
void saveClicked();
void cancelClicked();
}
BarView getNestedBarView();
}
A click event on the Save button becomes a call to
delegate.saveClicked(), basically translating browser events to semantic
method calls. Dan Danilatos covered it in detail here:
http://code.google.com/events/io/2010/sessions/gwt-continuous-build-testing.html
Back to the patch, if I read it right you're making the fields of a
uibinder owner define its public API, which seems like a pretty bad
thing to encourage. To avoid leaking business logic into your views
you're flooding your controller with knowledge of its view
implementation. How do you test these things? How does the next guy know
whether his event handler belongs in the view or the controller?
I agree that we need a more general low-labor way to bind events in a
GWT app, but this doesn't seem to be it. Am I missing something?
http://gwt-code-reviews.appspot.com/923801/show
--
http://groups.google.com/group/Google-Web-Toolkit-Contributors