I don't think DataSets are appropriate to this problem. But i'm not sure what is. I've never encountered anything like this before so my approach may be wrong. I'll try to describe the application and my approach.
1) There is a hierachy of configurations, where a configuration represents a setup for physical goods. The hierachy represents their association.
2) Each configuration contains a block (Tree) of layout data for a visual designer, a block of Aggregates, and a number of other blocks representing various tertiary data tied to the configuration.
3) A number of different controls are bound to the blocks of data for a selected configuration, as well as a number of controls being bound to the hierachy of configuration (From point 1).
4) I am attempting to implement an MVC pattern, where the model would be the XML DOM, the view would be the various controls that are bound to the model, and the controller is the host form (for now) that handles events submitted from the various controls.
5) When the model is changed, i would like to update the views with the changes made. (This is my primary problem). I do not want to re-query the model completely and re-draw the UI when a block is changed, i am only interested in the actual changes made.
6) I require Undo / Redo functionality (Simple enough with an XML Document)
7) Not all displayed data is stored in the model. When the model changes an alternative data source is queried to load Images, Layout data and other values.
It makes me really appreciate how easy web development is when you just re-poll the model and draw a new page / widget.
If you could point me in the right direction with regards to an approach to this problem, it would be greatly appreciated. Alternatively design patterns that are relevant or strategies for solving any of the above issues individually would be just as good.
I don't think DataSets are appropriate to this problem.
If you think it is obvious from your post it's not, at least to me. I have implemented several .NET Desktop applications that use MVC with a DataSet at the core of the Model. In some cases the Data source is an XML file. However in most cases I started out thinking XML files would work and quickly moved on to using the SQL Desktop Database.
Our main .NET Desktop/Web application uses a Database with NHibernate and an Object Model. In my experience and listening to others on the internet talk about managing the session and data layers from a development standpoint, there is no silver bullet, period. You can't just drag and drop controls and handle events to generate a complete solution. If your project data has any level of complexity, and yours certainly does, you will have to do some development. Also IMHO Databases still rule when it comes to managing complex data relationships. If your project is large enough you might want to look into the Castle ActiveRecord implementation[^] which uses NHibernate.
Thanks for the input. I Can't explain why DataSets are not appropriate, as i'm not sure what concrete reasons i have. I just have a feeling that going down that route would produce bad results, and i've been stung by DataSets before.
In the end, i decided to go with a bog standard XML DOM, and build an API Class(s) that applies transformations, queries the data, and raises application specific events when the DOM changes. I'll just see how it goes.
Some friendly advice. Don't base your technical decisions on your feelings. Seriously, in todays world the availability of information eliminates the need to make blind decisions that were common years ago and resulted in the mountains of Technical Debt[^] that exist in the industry today.
Well, i'm trying to route all events through a single root object, only wiring up a hierachy of observable lists, trees and properties to do that will be an absolute nightmare as the model is growing almost daily.
Additionally, i need to be able to run XPath queries on any part of the model and define some kind of schema to validate against. Which i couldn't do with objects.
It's a desktop app if that makes any difference, and the XML would be the state of the solution and everything pretty much revolves around changing that and keeping display parts synchronized with it.