Jens Nehlmeier has posted comments on this change.

Change subject: Introduces generic Composite widgets.
......................................................................


Patch Set 4:

I have once written a widget that does this foo.getDelegate().addXyzHandler() style but it comes with the cost that you can not use @UiHandler with it. If you are used to UiBinder its pretty annoying to not have @UiHandler support for a widget so at the end I actually added foo.addXyzHandler() methods to the widget and forward them to the delegate and obviously keep getDelegate() public so you are able to match against the event source.

It works ok'ish once everyone gets used to this style but API wise it just doesn't feel that great. First, the "problem" with making it UiBinder/UiHandler compatible is that developers just don't read the JavaDoc of the forwarding method foo.addXyzHandler() which states that they should use foo.getDelegate() when matching event sources. Thats because they don't call the method on their own when using UiHandler. Secondly, once you have these forwarding methods and a public getDelegate() you end up with two ways of adding handlers.

So I doubt that making Composite.getDelegate() public is a good choice. You end up with widgets that are similar to SuggestBox and DateBox that give access to their internals (which may result in deprecated methods in the future like SuggestBox.getTextBox()).

--
To view, visit https://gwt-review.googlesource.com/2582
To unsubscribe, visit https://gwt-review.googlesource.com/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: I41e5c07e978d442db7d8402c57605cec1b3ea09e
Gerrit-PatchSet: 4
Gerrit-Project: gwt
Gerrit-Branch: master
Gerrit-Owner: Goktug Gokdogan <gok...@google.com>
Gerrit-Reviewer: Brian Slesinsky <skybr...@google.com>
Gerrit-Reviewer: Goktug Gokdogan <gok...@google.com>
Gerrit-Reviewer: Jens Nehlmeier <jens.nehlme...@gmail.com>
Gerrit-Reviewer: Leeroy Jenkins <jenk...@gwtproject.org>
Gerrit-Reviewer: Matthew Dempsky <mdemp...@gwtproject.org>
Gerrit-Reviewer: Thomas Broyer <t.bro...@gmail.com>
Gerrit-HasComments: No

--
http://groups.google.com/group/Google-Web-Toolkit-Contributors
--- You received this message because you are subscribed to the Google Groups "GWT Contributors" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-web-toolkit-contributors+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to