GWT 地点和地点活动——传递藏品
我对 GWT 和 MVP 还很陌生,我认为我的客户端设计可能走错了路。我有一个地点/活动对(例如 ListContactsPlace),它向用户呈现一个联系人列表(大约 10k 个)。
允许用户从表中选择联系人,然后他应该能够对所选集合执行不同类型的操作,例如:
- 将所选联系人导出到 PDF 文件等。
- 向选定的联系人写大量电子邮件。
- ...
由于每个操作都有相当的复杂性,我希望每个操作都有一个单独的位置,例如 ExportPdfPlace、SendMassEMailPlace 等。
但是我应该如何将对象集的引用传递到这些位置?对地点集合进行标记听起来不是一个好主意,因为它可能包含相当多的条目。仅将集合引用传递给这些位置是一个坏主意吗?或者我应该考虑在 ListContactsPlace 中执行这些操作?
预先感谢您的任何建议。
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.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我使用 集合.不可修改XYZ。它的内存占用量很小,并且不涉及复制。每个活动都从我构建的中央数据库类获取其视图,但您也可以将列表发送到活动构造函数中。
我知道我不知道的一件事是:几位 GWT 工程师暗示您应该只使用继承树上较低的具体类,而不是像
List
或这样的高级接口>集合
。我只是忽略了这个建议,因为继承太有用了,但你可能比我更想研究这一点。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.