It looks to me like Guit leans toward the "Abstracted Control View" approach, as indicated by the @ViewField annotations on the HasText fields.
The @ViewHandler annotated methods are a little bit of a gray area. I'm guessing the generated code would look similar to the view implementation of the "View Delegate" approach. However, having the presenter coded to the GWT events (e.g., ClickEvent, whether by method naming convention or the event attribute of @ViewHandler) rather than an explicitly defined interface feels more like "Abstracted Control View" again. While the code might not look the same, it looks like most of the considerations for the "Abstracted Control View" approach would apply to Guit as well. -Brian On Tue, Mar 1, 2011 at 2:42 PM, Gal Dolber <[email protected]> wrote: > Guit doesn't use any of those patterns. In guit mvp is like uiBinder (only > two files, one ui.xml and one java). > Login.ui.xml (this is what you already know): > > <!DOCTYPE ui:UiBinder SYSTEM "http://dl.google.com/gwt/DTD/xhtml.ent"> > > <ui:UiBinder xmlns:ui="urn:ui:com.google.gwt.uibinder" > > xmlns:g="urn:import:com.google.gwt.user.client.ui"> > > <ui:style> > > </ui:style> > > <g:HTMLPanel> > > Username <g:TextBox ui:field="username"></g:TextBox> <br/> > > Password <g:TextBox ui:field="password"></g:TextBox> <br/> > > <g:Button ui:field="login">Login</g:Button> > > </g:HTMLPanel> > > </ui:UiBinder> > > Login.java (this is a presenter on guit): > > @GwtPresenter > > @AutoFocus("username") // Set the focus to username textbox when the view > gets attached > > public class Login extends LoginPresenter { > > // In @ViewField you can also use your own interfaces and guit will > emulate them (i.e if you create HasVisible you don't need to extend the > widget, if the widget have the methods of the interface, it just works) > > @ViewField > > HasText username; > > @ViewField > > HasText password; > > // For event binding guit uses this convention, you can also do it > like this @ViewHandler(event=ClickEvent.class, fields="login") and use any > method name. This convention gets validated with an apt plugin. > > @ViewHandler > > void login$click() { > > tryLogin(); > > } > > @ViewHandler > > @KeyCode({ KeyCodes.KEY_ENTER }) > > void login$username$password$keyPress() { > > tryLogin(); > > } > > private void tryLogin() { > > String u = username.getText(); > > String p = password.getText(); > > // Do the login logic > > } > > } > > Hope the example is clear > > Regards > > On Tue, Mar 1, 2011 at 3:06 PM, Kayode Odeyemi <[email protected]> wrote: >> >> hello, thanks for sharing this. I am having some challenge with its >> implementation though(using the Ray Ryan's method). How do I use the >> go() method to serve multiple views if its local type is of >> HasWidgets? >> >> On 3/1/11, Erik Bens <[email protected]> wrote: >> > Hi, >> > >> > perfect overview - thanks! I already worked with this architecture and >> > have to say it is very easy to handle after some tests. Additionally >> > use GIN for binding Views and Presenters will makes it easier too. >> > One question: Is this architecture also possible with the new >> > activity / places approach? Does someone has a diagram / sample for >> > it? >> > >> > Erik >> > >> > On Mar 1, 6:43 pm, Brian Reilly <[email protected]> wrote: >> >> Very good article! Thank you for contributing it! >> >> >> >> I would be interested to hear from creators/users of the MVP >> >> frameworks out there (gwt-mvp, gwt-platform, gwt-presenter, mvp4g, >> >> etc.) about which approach is used in each of the frameworks or if the >> >> frameworks are approach-agnostic. >> >> >> >> -Brian >> >> >> >> On Tue, Mar 1, 2011 at 10:38 AM, Geoffrey Wiseman >> >> >> >> <[email protected]> wrote: >> >> > If you're using Model-View-Presenter with GWT (or you're thinking >> >> > about it), there are a number of different patterns you can use to >> >> > co- >> >> > ordinate between your view and the corresponding presenter. Ray >> >> > Ryan's >> >> > "Best Practices for Architecting your GWT App" at I/O 2009 showed off >> >> > one pattern, Daniel Danilatos refined that for his "GWT Testing Best >> >> > Practices" presentation during I/O 2010, and a third pattern was used >> >> > in the "Large-Scale Application Development and MVP" article in the >> >> > GWT wiki. Using these and my own experiences with these patterns, >> >> > I've taken a small example, demonstrated how to apply each of these >> >> > patterns to that example, and written up some of the advantages and >> >> > disadvantages. >> >> >> >> >> >> > >http://blog.codiform.com/2011/03/view-presenter-interaction-patterns-... >> >> >> >> > These patterns are by and large available already in the sources >> >> > above, but by bringing them together and talking about some of the >> >> > pros and cos, I hope to save some people some of the sorts of >> >> > experimentation that many of us will have already gone through to >> >> > decide which one of these patterns works best for us. >> >> >> >> > -- >> >> > 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 >> >> > athttp://groups.google.com/group/google-web-toolkit?hl=en. >> > >> > -- >> > 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. >> > >> > >> >> >> -- >> Odeyemi 'Kayode O. >> >> B.Sc(Hons) Econs, Application Developer & Systems Engineer (Sun Certified >> Professional), >> Oracle Certified Associate, Solaris Systems Administrator, Drupal >> Developer >> >> Website: http://sinati.com <http://www.sinati.com> >> Socialize with me: http://profile.to/charyorde, >> http://twitter.com/charyorde, >> >> http://www.google.com/profiles/dreyemi >> Skype:drecute >> >> -- >> 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. >> > > > > -- > Guit: Elegant, beautiful, modular and *production ready* gwt applications. > > http://code.google.com/p/guit/ > > > > > -- > 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. > -- 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.
