I've been puzzling over how best to architect an application I'm due to begin work on shortly and nothing simple is coming to mind. Maybe someone else can see something that I'm missing.
The objective is pretty simple -- construct an app in C#/WinForms to allow the user to specify a file to be loaded, then visualize that file's contents in 3D, allow the user to tweak some properties, and then run a simulation.
The tricky part is the back-end. I have two files to load.
The first isn't specified by the user, but rather comes out of an older C++ application and is XML format and will be loaded automatically. The XML file describes its object structure - each class, its properties, and the corresponding min, max, and default values for those properties, as well as a text field documenting the property. This file is used to set up/define the classes/properties. This file continues to change on a fairly regular basis, so the objective here to is import these XML definitions so as not to link this new UI too closely with the older app.
The second file contains the input that is relevant to the user. This file describes what objects will be used and the values relevant to a subset of the classes/properties described in the first file.
That's it.
As I said, I've considered several ways of doing this, but they all seem archaic. One method I've thought about this: First, create a factory/dispatcher that reads and constructs a class of type 'Loadable' to represent those classes defined in the XML; then create a generic 'Property' to store the properties themselves and store them in a collection of some sort within the Loadable object. My thought is that this way, I can reference those Loadables later on when loading the user's file or when pulling them up in a PropertyGrid for user-editing.
Thoughts? Am I on crack? Is there a simpler way to tackle this that I'm not seeing through the trees? Any comments would be welcome.