tag:blogger.com,1999:blog-7453872857219605475.post2474168165405866747..comments2022-12-04T19:25:36.445-08:00Comments on Codiform: View-Presenter Interaction Patterns in Google Web Toolkit (GWT)Geoffrey Wisemanhttp://www.blogger.com/profile/05205826495553720705noreply@blogger.comBlogger9125tag:blogger.com,1999:blog-7453872857219605475.post-11223122535002635652011-04-26T08:48:09.107-07:002011-04-26T08:48:09.107-07:00Don't worry, someone will develop the next rou...Don't worry, someone will develop the next round of XDoclet soon to save us from all these files. ;)Geoffrey Wisemanhttps://www.blogger.com/profile/05205826495553720705noreply@blogger.comtag:blogger.com,1999:blog-7453872857219605475.post-65610007326680981662011-04-26T03:17:19.929-07:002011-04-26T03:17:19.929-07:00GWT MVP seem like a hugely over-engineered solutio...GWT MVP seem like a hugely over-engineered solution to a simple problem. For each "view" I need at least 4-5 artifacts.<br /><br />MyView<br />MyViewImpl<br />MyViewImpl.ui.xml<br />MyViewPresener<br />MyViewPresenerImpl<br /><br />Now, if we add Places and Tokenizers we reach 7 artifacts. Multiply that by a dozen of different views and all the necessary plumbing and I need an army of developers to maintain one app. Compared to that, EJBs pale in complexity! But who cares, we have reached the noble architect goal, maximum level of abstraction and faster unit tests.Dimitrios Menounoshttps://www.blogger.com/profile/07416863812258576754noreply@blogger.comtag:blogger.com,1999:blog-7453872857219605475.post-67053417041087452542011-03-02T07:33:36.481-08:002011-03-02T07:33:36.481-08:00Thanks for the pointer about the other article. I ...Thanks for the pointer about the other article. I should have noticed that.<br /><br />After re-watching the first half of GWT Testing Best Practices, I think that what Daniel Danilatos shows there is more like the View Delegate approach, at least in the ThumbnailWidget example. The only difference is that the presenter interface is defined inside the view interface (and is called a "listener"... a convention I prefer over what's shown in "Large scale application development and MVP"). Maybe it's purely philosophical, but I feel like there's a difference between coding to an explicit view interface and coding to the GWT widget and event handler interfaces; Daniel's Thumbnail example is definitely the former, while the "Interaction View" approach shows the latter.<br /><br />Still, I think this is a great summary of applications of MVP that have been demonstrated for GWT. I also see it as an evolution where the "View Delegate" approach is the latest generation and may remain stable for the foreseeable future.Brian Reillyhttps://www.blogger.com/profile/07056473468154339200noreply@blogger.comtag:blogger.com,1999:blog-7453872857219605475.post-80335634344177861472011-03-01T14:08:40.342-08:002011-03-01T14:08:40.342-08:00@karthik reddy:
Activities and Places have actuall...@karthik reddy:<br />Activities and Places have actually nothing to do with MVP. They're about navigation within the app. See http://tbroyer.posterous.com/gwt-21-activities (and the previous articles in the series)Anonymoushttps://www.blogger.com/profile/08913751914931017350noreply@blogger.comtag:blogger.com,1999:blog-7453872857219605475.post-16425168921038562422011-03-01T11:35:44.695-08:002011-03-01T11:35:44.695-08:00Can this possibly be tied with the approach postul...Can this possibly be tied with the approach postulated at http://code.google.com/webtoolkit/doc/latest/DevGuideMvpActivitiesAndPlaces.html using pure Activities and Places. My understanding is that Activities and Places is the paradigm that is being adapted going ahead by the GWT team.karthik reddyhttps://www.blogger.com/profile/12413336761883742838noreply@blogger.comtag:blogger.com,1999:blog-7453872857219605475.post-80812193579972626252011-03-01T10:13:37.942-08:002011-03-01T10:13:37.942-08:00@Thomas Broyer:
I did briefly experiment with the ...@Thomas Broyer:<br />I did briefly experiment with the multi-interface generics approach, but I abandoned the experiment, and I don't remember why. I'll have to give that another look-see, see if there's a problem that I've forgotten, or if it's a viable path. It's slightly ugly, but probably less so than interfaces like EditableClickableText. ;)Geoffrey Wisemanhttps://www.blogger.com/profile/05205826495553720705noreply@blogger.comtag:blogger.com,1999:blog-7453872857219605475.post-12932557689093124212011-03-01T10:10:46.768-08:002011-03-01T10:10:46.768-08:00@Brian Reilly:
The main reason I didn't talk a...@Brian Reilly:<br />The main reason I didn't talk about testing and testability in this article, is that I'd written the previous one almost entirely on that subject -- although it might have made sense to talk in the introduction to this article why one might consider MVP.<br /><br />Most of the MVP frameworks around GWT were just starting out when we started out project, so I haven't dug into them in detail recently. I'll see if I can carve out some time to look at these more closely and see how they relate.<br /><br />Thanks for your comments.Geoffrey Wisemanhttps://www.blogger.com/profile/05205826495553720705noreply@blogger.comtag:blogger.com,1999:blog-7453872857219605475.post-90161109410863738282011-03-01T09:41:11.143-08:002011-03-01T09:41:11.143-08:00Excellent article! It should be required reading f...Excellent article! It should be required reading for anyone before they use "MVP" in conversation.<br /><br />I think the subject of testing deserves more emphasis. MVP is nice for splitting things up conceptually, but its real purpose is to achieve fast unit tests for code dealing with UI interactions. How each approach affects those tests would make a great follow-up article.<br /><br />I'm also curious to know which approaches are used in which MVP frameworks (gwt-mvp, gwt-platform, gwt-presenter, mvp4g, etc.) or if the frameworks are agnostic toward this.<br /><br />Finally, thank you for not using the word "activity". While GWT's activities and places are useful, they are not an implementation of, nor do they favor any of the above approaches to, the model-view-presenter pattern.Brian Reillyhttps://www.blogger.com/profile/07056473468154339200noreply@blogger.comtag:blogger.com,1999:blog-7453872857219605475.post-71392818181456061292011-03-01T08:02:01.765-08:002011-03-01T08:02:01.765-08:00I love your UML diagrams showing the mess with int...I <b>love</b> your UML diagrams showing the mess with interfaces, but I believe (though I haven't verified) that you actually don't need an "EditableClickableText" interface if you use generics with intersections:<br /><br /> <T extends HasText & HasClickHandlers & HasEnabled> getLoginButton();<br /><br />Of course, it doesn't solve the issue where there's no available interface (HasVisibility, HasStyles) or widget doesn't implement the interface you want/need.<br /><br />The major benefit of the "Interaction View" approach is for mocking in unit tests.Anonymoushttps://www.blogger.com/profile/08913751914931017350noreply@blogger.com