1

I am trying to use CellTree, i am confused about placement of class implementing TreeViewModel, This class will need Collection of elements required to be rendered as tree if this is view type class i need to push collection from the presenter. If its a Presenter class i can directly call the server function and get the collection.

I am finding it more near to Presenter.... please sugget

Saket Bansal
  • 156
  • 1
  • 12

1 Answers1

0

According to GWT docs,

A key concept of MVP development is that a view is defined by an interface. This allows multiple view implementations based on client characteristics (such as mobile vs. desktop)

So, looks like Presenter should know neither about data presentation widgets used in view implementation, nor about specific ViewModels and data providers used by these data presentation widgets (since data presentation widgets may be changed). ViewModels are generally coupled with particular way to implement data presentation, so I usually consider them as a part of View.

I usually create presenter methods like getObjectsList(params), which return array / list of required data, and then transform these results to ViewModel.

BTW, it would be great to hear other opinions :)

Kel
  • 7,680
  • 3
  • 29
  • 39