Search code examples
silverlightentity-frameworkarchitectureria

Best Practices for Managing/Loading Data in Silverlight Client from Server


I am developing a Business Application which is flooded with data. For each functionality, I have one ViewModel and for each of this ViewModel, I create one Separate Db Context object. To be more clear ..

i.e. There are almost 5 to 8 Functionality where I need Customers list. and to get them, I create Separate Db Context and Load Separate List from Server in each ViewModel. there are lots of redundant Data Download with multiple Db trips. which occupies too much space RAM and slows down the performance. It might affect Performance in many difference ways. I was wondering What is the Best Practices for handling such massive data and optimize the performance of the Application?

I think one solution is to maintain common data pool across whole application But am little bit confused how to design it properly so that it won't create some other bottleneck for the Application. And There must be some Standard solution for this too..

Thank you so much for your time and help.


Solution

  • One option is to create a SharedViewModel as a singleton and inject it into ViewModels that need the shared data. I do this and it works well.

    Another option is to use something like SterlingDB, a local document database for SL/WP7, and store the data in isolated storage.