On the GWT wiki there is a new article (http://code.google.com/
webtoolkit/doc/latest/tutorial/mvp-architecture.html) with good
example of how MVP code "should" work.  I found the following quote
interesting...

"Method setData() is a simple way of getting model data into the view
without the view having intrinsic knowledge of the model itself"

In the example there is only one column of date in the contacts table/
list which meant the view can draw itself based on a List<String>.
What if the view was meant to display multiple columns a List<String>
as seen in ContactsPresenter.fetchContactDetails would not work.

I see three options...

Change this to List<ContactDetails> but then the view references the
model

Create a new class like ContactDetailsRowData that is essential
ContactDetails minus any non-viewed fields (ie: primary key).

Break down each row in the table into it's own widget, this tends to
get very messy though and seems hackish.

I am currently leaning towards setting the view's data as a
List<ContactDetails> and just making sure that the view only uses
model data to display the user interface, it doesn't try to fire
events like SelectionEvent<ContactDetails> but rather sticks to
ClickHandlers and providing methods like getSelectedIndex().

Any ideas?

--

You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To post to this group, send email to google-web-tool...@googlegroups.com.
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.


Reply via email to