With the .NET RIA Services July 2009 Preview, the DomainDataSource now enables some scenarios that were previously blocked. Most namely, we now allow you to change your current page while there are pending changes in the data. Editing and paging seemed like a common enough scenario that we wanted to enable it, so we’ve done so in the recent drop.
There are actually many scenarios opened up right now that we’re reviewing. I’ll be frank: many of the following scenarios are probably doing really wonky things in the current bits. So here’s your chance to help us determine how these scenarios should behave by telling us how you’d use them in your applications!
1. Editing and Paging
Let’s start with the simple target scenario that we were going after. The DDS is paging, and you have pulled down a couple of pages of data. You edit a record. Should you be able to page through the data and make other changes, or should you be stuck on the page containing the first edit?
2. Adding and Paging
You add a new record, what page does it get added to? Can you move around through the pages, but always find the added record on the page it was added to?
3. Editing and Sorting
When a record is edited, should it be re-sorted to fit in based on its edited values, or does it maintain its sort position based on how it was loaded from the server?
4. Editing, Sorting, and Paging
If you’re viewing page 3, and you edit a record, and then you re-sort, what happens? Are you taken to page 1? Does the record get loaded onto the page that the server thinks it belongs to or does it stay assigned to the page it was edited on? Or do we just disable sorting when there are pending changes because this seems too goofy?
5. Adding, Sorting, and Paging
If there is a pending add on page 3, and you change the sort, what happens? Are you taken back to page 1? Does the added record stay on page 3 or does it now display on page 1? Or do we just disable sorting when there are pending changes because this seems too goofy?
6. Editing and Filtering
What does it mean when the filter changes to exclude the record as it exists on the server? What does it mean when the filter changes to exclude the record based on it’s edited state on the client? Or do we just disable filtering when there are pending changes because this seems too goofy?
7. Adding and Filtering
You’ve done a filter (cities in Washington), and you add a new record that doesn’t match your filter (Cincinnati, Ohio). Does it hide immediately, or show up despite not meeting the filter? What happens if you change the filter to where the record again doesn’t meet the filter (cities in California)? Or do we just disable filtering when there are pending changes because this seems too goofy?
Many, Many More Scenarios
There are scores of questions like these. Filtering and Sorting are causing me the most anxiety, so I’m leaning toward blocking filtering, sorting, and grouping (which does a sort) whenever there are pending changes. The results are just too unpredictable. Some of my team members have been voicing this concern as well, but I’ve been bull-headed, wanting to open these scenarios up. But perhaps it’s not worth it.
So please, share with me any real-world scenarios you have where you need a very heavy mixture of editing, adding, deleting, sorting, grouping, filtering, and paging or incremental loads (using LoadSize and LoadInterval, but not PageSize), or any combination of these. Should we throw an InvalidOperationException if you attempt to sort, filter, or group when there are pending changes? Should we stop performing incremental loads when there are changes? We’d still allow paging (we have this pretty well covered), but none of the other server operations would be allowed.
Also, please help me distinguish between actions the DomainDataSource should block and actions your applications would block, but you'd still like to have enabled in DomainDataSource, just in case.
Thanks in advance for the feedback!
And for those of you that follow me on Twitter… Yes, I did actually create a Silverlight-based survey with these questions, and it’s fully functional after about 2 hours work. But as I was beginning to deploy it, I thought it would be better just to stick with comments on the blog post, as that will harbor more exchanges of thoughts, rather than just a blind survey submission where you can’t see any else’s responses.