MVP questions

2 views
Skip to first unread message

Bilousme

unread,
Jun 16, 2010, 11:20:51 AM6/16/10
to Google Web Toolkit
Hello all,

I need some help to check if my design I choose is correct.
Imagine I have a data model like that :
- An object1 containing a list of many object2

Imagine now I want that my screen displays info of object1 and the
list of object2 inside a tabpanel. When you click on a tab, you
display the info of the selected object2.

What is the best way to implement that ?
1) only one couple of presenter/view for object1 and this couple
manages the display of object2 in each tab
2) one presenter/view object for object1 and one presenter/view for
each instance of object2 ?

in other words, do I have one couple of presenter/view by object
model ?

Olivier Monaco

unread,
Jun 17, 2010, 4:08:00 AM6/17/10
to Google Web Toolkit
Hi,

Depending on the "size" of object2, I will use a dedicated presenter
or not. Commonly, I like to have a dedicated one so I can easily reuse
it, extends it... and, more important, I have more encapsulation,
reducing the complexity of my code.

Olivier

Bilousme

unread,
Jun 17, 2010, 9:37:39 AM6/17/10
to Google Web Toolkit
Ok but what recommend the MVP pattern ?
- one View/presenter by screen ?
- one view/presenter by data object model...
It's not really clear (at least for me)
> > model ?- Hide quoted text -
>
> - Show quoted text -

Tristan

unread,
Jun 17, 2010, 10:37:06 AM6/17/10
to Google Web Toolkit
I'd do it the second way, for reasons Olivier pointed out.

Elmaho

unread,
Jun 16, 2010, 11:49:06 AM6/16/10
to Google Web Toolkit
Hey,

In my opinion you'll need only one presenter/view with interface
containing a method to request object2 in each tab selection. These
objects are too related to be separated.

Like I said 'In my opinion'
Hope this help
Reply all
Reply to author
Forward
0 new messages