On Monday, March 12, 2012 6:24:26 PM UTC+1, Colin Eberhardt wrote: > > This might be of interest to members of this group ... > > I have contributed a GWT version to the JavaScript TodoMVC project: > > > http://www.scottlogic.co.uk/blog/colin/2012/03/developing-a-gwt-todomvc-application/ > > > For those of you who have not come across this project, it provides an > implementation of the same simple todo application with a wide range > of JavaScript frameworks (18 at the moment). I noticed it was lacking > a GWT implementation, hence my contribution, which has been reviewed > and accepted :-) > > Here is the project homepage > > http://addyosmani.github.com/todomvc/ > > And my GWT implementation in action here: > > http://colineberhardt.github.com/ >
A few remarks: - I would have passed the task's text to addTask rather than having a getTaskText() on the view (i.e. make the presenter manage the state, and the view only display it and route user events to the presenter) - Instead of wrapping everything in a UiBinder, I would have kept part of the template in the HTML host page (I'd have wrapped only the <div id=todoapp>, keeping the static instructions and credits sections in the HTML host page) - I would have called the ViewEventHandler interface 'Presenter' (as many people do it), and use a setter on the view (setPresenter) rather than an observer-like method (addViewEventHandler) - I wonder if you could have used a CompositeCell to split the "done checkbox" and "delete button" handling in their own cells - I really don't like having that delete() method in the ToDoItem class, that's something that should go in the Presenter (you're doing MVP, not MVC). The setDone should IMO also go through the presenter as that one needs to be notified (the presenter would then call setDone on the model); there's no need to do it for setTitle(). The fact that the model knows the presenter is a sign that this is not actually a "model" but rather a "view model" (MVVM). - I don't understand you 'data-timestamp' hack in the Cell; it looks to me like you should have used ViewData and rely on the existing AbstractEditableCell behavior, but there might be reasons you didn't do it, and/or I might be wrong. - I would have used AutoBeans for the JSON serialization, instead of JSONParser/JSONValue and the like (which are a PITA to use) - I would have used Guava for the various string and list processing - Hiding the footer should be controlled by the presenter, not hidden in the view, IMO (easier to unit-test if you ask me; btw, you didn't unit-test your presenter) -- You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group. To view this discussion on the web visit https://groups.google.com/d/msg/google-web-toolkit/-/V2LVi9lEkNUJ. 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.
