Stephen Haberman has posted comments on this change.
Change subject: Add interfaces for widgets.
......................................................................
Patch Set 8:
doesn't fit into current IsXXX because if it was you wouldn't need
IsWidget2 :)
My take is that it's just because IsWidget is already a public API, and
can't have methods added to it without being a breaking change.
very common practice for testing in java
Given Java's history, I don't believe that something being "common in Java"
is necessarily a good argument. :-)
Or, less cynically, mocks being common shouldn't mean they should be the
*only* way of testing (which is how it is with GWT right now).
You cannot do what you exactly want ... in (AWT, SWT, Swing, Android)
Right, and MVP-style unit testing subsequently sucks in them as well.
Same boilerplate hell of hand-coding your own view interfaces/impls/etc.
See some of the papers from Atomic Object.
AWT/SWT/Swing were all created before MVP/unit testing was popular in the
Java community, so it is not surprising they were not designed with unit
testing in mind. This is an opportunity to fix that.
"Answer" can be implemented by just using naming conventions (i.e. store
x on setX and return it on getX)
That works for Style, but I've stubbed about 80-90% of the widgets, and by
far most of the methods are not trivial based-on-the-name-implementations
like that.
forward calls to your handwritten StubElement - which doesn't need to
extend the StubElement.
That sounds painful as you wouldn't have any compiler support about whether
you've implemented the right methods or not.
Also, then you can't use covariant return types to provide tests with
test-specific helper methods on the not-really-Element StubElements.
Ironically, we are both wanting to do the same thing (do MVP directly
against widgets), and both had to write code outside of GWT to do so
(gwt-mockito/etc. and Tessell).
Obviously I can keep doing what I'm doing in Tessell, my assertion is just
that these interfaces would be useful in GWT itself.
They make both mocking and stubbing easier, because then both supported
out-of-the-box instead of having to be hacked around.
Yes, we can be annoyed that Java requires duplicating an API in interfaces
and the implementation, but I believe that's a cost that we as Java users
have collectively decided to carry.
So, I understand you don't have an interest in using these interfaces;
that's fine, but myself (and at least a few others) do.
I think part of a healthy open source project is letting in changes that
the maintainer(s) themselves may not necessarily use, but that other users
want.
Obviously there is a balance here, and you can't let in every single
commit. But I believe it's surprising how many patches can generally be let
in.
For example, see the Spark project, whose maintainers, sans typical
style/architecture issues, let in a wide range of community patches.
As a contributor (to Spark), it's very refreshing. And I believe as a
direct consequence, Spark has a very healthy community of contributors
(much, much more healthy than GWT for sure).
So, I very much want your feedback, Goktug, on making this patch as good as
it can possibly be from an implementation perspective; but I'd hope you'd
avoid -1'ing just because you personally wouldn't use it.
--
To view, visit https://gwt-review.googlesource.com/3231
To unsubscribe, visit https://gwt-review.googlesource.com/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: Ibd17162d37e367720829bcdaf9a350e446c833b9
Gerrit-PatchSet: 8
Gerrit-Project: gwt
Gerrit-Branch: master
Gerrit-Owner: Stephen Haberman <stephen.haber...@gmail.com>
Gerrit-Reviewer: Colin Alworth <niloc...@gmail.com>
Gerrit-Reviewer: Daniel Kurka <danku...@google.com>
Gerrit-Reviewer: Goktug Gokdogan <gok...@google.com>
Gerrit-Reviewer: Leeroy Jenkins <jenk...@gwtproject.org>
Gerrit-Reviewer: Stephen Haberman <stephen.haber...@gmail.com>
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.