I'm pretty new to GWT and MVP and thinking I MAY be going the wrong way with my client design. I have a place/activity -pair (e.g. ListContactsPlace) that presents the user with a table of contacts (around 10k of them).
The user is allowed to select contacts from the table and he should then be able to perform different kinds of operations on the selected set, for example:
- Export the selected contacts to a PDF file and many others.
- Write mass e-mail to the selected contacts.
- ...
Since each of these operations has got quite some complexity, I would like to have a separate Place for each of them, e.g. ExportPdfPlace, SendMassEMailPlace, etc.
But how should I be passing reference of the set of objects to the places? It doesn't sound like a good idea to tokenize the set for the places as it may include quite a lot of entries. Is it a bad idea to just pass the set reference to the places? Or should I rather be thinking about performing these operations within the ListContactsPlace?
Thanks in advance for any suggestions.
I pass unmodifiable views with Collections.unmodifiableXYZ. It's a low memory footprint, and no copying is involved. Each Activity gets its view from a central Database class I've constructed, but you could also just send the lists into the Activity constructor.
The one thing I know I don't know: a couple of GWT engineers have implied that you should only use a concrete class low on the inheritance tree, not a high-level interface like
List
orCollection
. I have just been ignoring that advice because the inheritance is too useful, but you might want to look into that more than I did.