Many thanks for your detailed reply! I got some nice information out of it (now I know there is something like GIN which sounds promising).
-- >Actually these things are all covered on gwtproject.org, except ClientFactory. But I think there is a GWT example project in the SDK that uses the ClientFactory pattern.
On Friday, January 10, 2014 8:40:51 PM UTC+1, Jens wrote:
>MVP using UiBinder: http://www.gwtproject.org/articles/mvp-architecture-2.html
Maybe I should give that a second and more serious look. At first glance I had the impression there where only code snippets (I assumed that because of the "..." inside the source examples).
In addition, these articles are from 2010 and do not use "Activities and Places" (but AppController and the outdated history mechanism).
As I generally like the gwtproject.org website, I for my part where to early released into the more abstract treatment of the various topics (in form of the articles). The usecases / projects used through out the articles are not consistent. As a beginner I find it difficult to make connections between the loosely coupled topics. Furthermore, gwtproject.org looks for me more like a reference oriented than a guide centric resource.
That said, I could imagine that this might be only because I'm new to web development as a whole as well. It could of course be totally my "fault".
What I am searching for is a "let's go through the best practice development circle of a gwt web app and use all the suggested architectural concepts there are in order to provide you, dear reader, with a basic but reasonable project you can use as a starting point for and adapt to your own projects"-kind-of-tutorial.
The book Joel suggested seems the nearest hit and I'll give it a try (and it seems to be the most recent resource).
Thanks again for your detailed reply. I already like this community ;-)
On Friday, January 10, 2014 8:40:51 PM UTC+1, Jens wrote:
Some inline comments below- Coupling the view to a "foo" activitiy (P in MVP)An Activity does not have to be a presenter. Always keep that in mind. An activity is simply something that starts/stops once a user visits/leaves a place. It can often take the role of a presenter just fine but if for any reasons things feel uncomfortable while writing an activity you might want to think about it.- Use of Event-, Activity- and PlacesManager ("AppController" is a deprecated pattern(?))Using EventBus gives nice decoupling while being able to broadcast general events in your app. Creating events requires some boilerplate code to write so you may want to check out https://github.com/google/gwteventbinder to save you some code.Places are GWT's way to handle navigation and support the browser back/forward buttons. I would definitely use it because its always annoying if you can not send someone else a link to "a place" in your app. It also just feels more natural if you can use back/forward buttons of the browser because thats what you do all day when surfing the web.- Use of ClientFactory for reusable ViewsClientFactory a form of dependency injection and is more about swapping view implementations easily. This is helpful if you want to share presenter logic but need different view implementations for desktop/tablet/mobile. It also comes in handy for testability of your presenters. During testing your view interfaces can be implemented by fake implementations using a FakeClientFactory. If you would use your real GWT views in tests then you would need to use GWTTestCase which is really slow compared to pure JUnit tests or you have to use a library like https://github.com/google/gwtmockito which does some magic to avoid using GWTTestCase even if you deal with real widgets.The code you write when using the ClientFactory pattern can also be generated by using https://code.google.com/p/google-gin/ .- Use of RequestFactory and EntityProxy as "M" part for DataBinding (using annotations)GWT's DataBinding features is the Editor Framework which also works with plain POJOs / Beans. So you are not required to use RequestFactory in order to be able to use DataBinding features. Also GWT's Editor Framework is not a "real time" data binding. What it does is it copies data from your model into the view (by using annotations and naming conventions), then you can edit everything in your view and finally you can call a flush() method which copies everything from the view back to the model. So there is no live update of label x while typing things in textbox y.A tutorial that uses all of the above mentioned paradigms at once would be much appreciated.Actually these things are all covered on gwtproject.org, except ClientFactory. But I think there is a GWT example project in the SDK that uses the ClientFactory pattern.Activities & Places for managing navigation: http://www.gwtproject.org/doc/latest/ DevGuideMvpActivitiesAndPlaces .html MVP using UiBinder: http://www.gwtproject.org/articles/mvp- architecture-2.html RequestFactory: http://www.gwtproject.org/doc/latest/ DevGuideRequestFactory.html Editor Framework: http://www.gwtproject.org/doc/latest/ DevGuideUiEditors.html -- J.
You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-web-toolkit+unsubscribe@googlegroups.com.
To post to this group, send email to google-web-toolkit@googlegroups.com.
Visit this group at http://groups.google.com/group/google-web-toolkit.
For more options, visit https://groups.google.com/groups/opt_out.
No comments:
Post a Comment