您能否推荐在大数据量上使用 WPF 开发分布式应用程序的最佳实践?
我们开始使用 WPF 开发分布式客户端服务器应用程序。
我正在寻找能够满足以下要求的最佳实践:
- 可以有多个可以在客户端组合的数据源。
- 服务器端数据可以用新的业务数据来修饰。
- 应用程序应该能够处理大量数据(网格中成千上万的记录)。
- 应同步多个客户端。即,如果一个客户端更改了当前在另一个客户端中显示的实体,则应将此通知另一个客户端。
如果您能参考讨论全部或部分问题的书籍/文章/博客/示例,我将不胜感激。
我正在更多地研究 MVVM + 域模型。
感谢您的帮助&时间
罗恩
We're starting to develop a distributed client server application using WPF.
I'm looking for best practices that can answer the following requirements:
- There can be multiple sources of data that can be combined on the client side.
- Server side data can be decorated with new business data.
- Application should be able to handle very large volume of data (hunders of thousands of records in the grid).
- Multiple clients should be synced. i.e. if a client changes an entity that is currently displayed in another client - the other client should be notified of this.
I'd appreciate any reference to books / articles / blogs / samples that discuss all or part of the issues.
I'm looking more into MVVM + domain model.
Thanks for your help & time
Ron
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我可能会要求你重申你的(3)点的必要性。应用程序逻辑是否真的需要向客户端提供如此大量的数据?如果您可以将其减少到最低限度,并让 DataGrid 存储滚动位置/过滤/搜索的状态,那么您始终可以在分页或滚动触发器上快速从服务器检索下一组结果。当然,与将 Select * from Table 作为 WCF 结果并将其绑定到 DataGrid 相比,这在客户端和服务器端都需要做更多的工作:)。我的观点是,您可能需要考虑服务器端数据虚拟化而不是客户端,这样您就不会提供用户永远不会看到的不需要的数据。
想想谷歌的搜索结果,浏览器只得到这百万结果中的一小部分,但服务器知道上下文。因此,我建议您探索这个想法并减少客户端的复杂性和工作量。使网络上的数据尽可能少,并将对服务器的调用作为少量数据的异步块。我相信你会得到更好的结果。
(4) 您可以使用双工绑定或某些惰性线程轮询机制,具体取决于您需要的更新速度。同样,那些更新通道消息传递应该尽可能小,以提高性能。
I may request you to reiterate the need of your (3) point. Does the application logic really need all that large volume of data to the client side? If you can reduce that to the minimum and have the DataGrid stores the states of the scroll position/filtering/searching, then you can always retrieve the next set of results from the server pretty fast on a pagination or on a scroll trigger. Of course this is way more work both at client side and server side than doing a Select * from Table as WCF result and bind that to a DataGrid :). My point is that you may need to think about the Server side Data-virtualization instead of client so that you won't deliver unwanted data which user will never look at.
Think about the Google search results, browser gets just a small fraction of those million results but server knows the context. So I would recommend you to explore that idea and reduce the client side complexities and work. Make the data across the network as minimum as possible, and do calls to server as asynchronous chunks of small amount of data. I am sure you will get far better results.
(4) You can use a Duplex binding or some lazy-thread polling mechanism depends on how fast you need the updates. again those update channel messaging should be as small as possible to improve the performance.