On Jul 22, 6:59 am, Daniel Wellman <etl...@gmail.com> wrote: > So it seems it's a tradeoff in how much test coverage you need -- > expose the low-level HasXyz interfaces in your view if you need more > automated test code coverage, or use a gateway interface to the view > which exposes higher-level methods like getPassword(). Using this > gateway means you lose test coverage of which specific widgets are > wired to a given Presenter callback, but you may be able to live with > that risk (a quick manual exploratory test might give you that > confidence).
If you think about it, there is more a spectrum than a clear separation between HasXyz as a low-level interface and a gateway interface to the view. Based on Ray's talk, the Display interface for each presenter is in effect the Gateway interface for the View and the HasClickHandler or HasValue interface components expose the expect interaction with that object. While these appear to be low-level, it all depends on how the View itself is implemented. For example, I could have a display interface for a UI that displays a list of contacts having a function like this: interface Display { ... HasSelectionHandlers<Integer> getSelectionButton(){} .. } The Display Gateway object specifies that the SelectionButton is responsible for producing selection events that return the index of the list item selected. However, from a UI perspective this could be implemented as a selection on a ComboBox, an HTML List, response to clicking on a FlexTable row, clicking on a Radio button, or even clicking a CheckBox next to the list item and then clicking on a "Make Selection" button object. The level of granularity depends, like you said, on how much interaction you want testable using JUnit tests rather than GWTTestCases, but it is not an either/or choice. I do see value in having HasXyzHandlers interfaces returned in the View Gateway interface as a way of testing asynchronous interaction is correct, since asynchronous interaction cannot be statically verified at compile time. -Jason --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group. To post to this group, send email to Google-Web-Toolkit@googlegroups.com To unsubscribe from this group, send email to google-web-toolkit+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/Google-Web-Toolkit?hl=en -~----------~----~----~----~------~----~------~--~---