2

I red google-gwt article about MVP and would like to ask about how you are creating the view layer. Suppose you have three different "elements" on one view, the Tree, the Table and Text. And now I think the best practice is to create these three elements decoupled (I mean that, if I don't want Tree "element", in my view, I would comment the line, with for instance setTree(...) in code, somewhere). Also I would like to use UIBinder for creating each of the "element"

So my questions are: Who should be responsible for creating such decoupled element like Tree or Table (Controller, Presenter or may View)

and

Who is responsible for setting such elements to the View?

Dawid D
  • 1,057
  • 13
  • 28
  • 1
    By "view" here, do you mean "the whole screen"? If so, then you should read [Activities and Places](http://code.google.com/webtoolkit/doc/latest/DevGuideMvpActivitiesAndPlaces.html) (and code each activity using MVP). Another highly-recommended reading about MVP: http://www.google.com/events/io/2010/sessions/gwt-continuous-build-testing.html – Thomas Broyer Oct 25 '11 at 09:37
  • Thanks, that was really helpful. I'm still diging this issue and I can't understend where should I keep/serve events in that project. Whether is to this some smart practice? – Dawid D Oct 27 '11 at 11:28

1 Answers1

1

The view should be responsible for assembling the widget components it needs. Your view class will be the one with a corresponding UiBinder file, and in that file you can combine a Tree, Table, and Label (or whatever).

Riley Lark
  • 20,660
  • 15
  • 80
  • 128