views:

26

answers:

1

I have a UI with a list of items and the detail of a selected item(typical master/detail scenario). In my case this is a Silverlight application but this question could apply to other programming models. When the application starts, the list portion of the UI is populated from a remote data source(SQL Server in my case) via WCF(which I control). The user can then select various entries in the list and view the details of the selected entry, add new entries and edit the current selection. The user has a save button to update the underlying data source. This is a multi user environment. Here are my questions:

1) When the application starts, should I get all the enties in the list as well as their detail or get the detail from the service when the user selects the entry?

2) When do I update the list from the service? After an edit or addition? Currently I get the updated entry back when a create or update is done and update the UI with the returned data as a part of concurrency checking. This way the list can get stale, it won't show entries other users may have made.

3) Should I always provide a refresh button to allow the user to manually refresh the list?

Let me know if I have not been clear about anything.

A: 
  1. That really depends on how heavy your data list is. If you are not displaying more than 30-40 items on a single page I would get the full entities to the list and then just display them in the details view. Of course, if your entities are data-heavy in themselves, with a lot of properties, nested lists etc, you might want to rethink that.

  2. Personally, I update my data lists immediately after any update/add/delete operation, precisely for the reason you mention; to get the items that other users may have added/updated/deleted.

  3. A refresh button is nice of course, especially if you have no search functionality. If you do have search functionality, that is pretty much the same as a refresh button. The user can just repeat their search to refresh the list.

Henrik Söderlund
(Concerning question 1) If on the other hand you are displaying huge numbers of items in the list, like several hundred, I would go the other way and construct a smaller entity used only for the lists. Then when the user wants to view details, just get the full entity from the service.
Henrik Söderlund
Thank you for your answer. This gives me a place to start. I thought this would be a common challenge and more developers would share their insight. Has anyone this issue addressed anywhere on the web?
DaveB
I guess you might get more answers if you tag the question "WPF" also. WPF has been around longer than Silverlight, so there has been more time for people to learn and develop best practices. And your question applies to both technologies.
Henrik Söderlund