> There are classes that have all these (Label is what I intend to use), but no > shared interface implementing all.
I wanted shared interfaces too--e.g. IsLabel that unites all of Label's HasText/etc. interfaces. I mentioned it in this thread: http://groups.google.com/group/google-web-toolkit/browse_thread/thread/31b9b6ecd86168f1 And have just started making them myself. Then my presenters can use a widget factory that returns the IsLabel interface, not the Label class. And the view will have methods like addNavBar(IsLabel label). Then I can unit test with a factory that returns a stub/non-GWT IsLabel. Taking the IsXxx/shared interfaces further, my views don't have addNavBar/etc. boilerplate methods and instead would just have one IsXxx method for each field in their ui.xml file (e.g. <gwt:SimplePanel ui:field="fooPanel"/> --> IsSimplePanel fooPanel()). Since this is very mechanical, I can generate the view interface and the view class from the ui.xml file, which cuts down on the boilerplate you mentioned. The presenter then just does view.fooPanel().add(myIsLabelFromFactory). At test time I can stub out IsSimplePanel, IsLabel, and the view. - Stephen -- You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.
