1

In our software we have a client/server architecture where the server is actually running on an embedded system with various hardware components (sensors, etc.). The different sensors as well as other features of the system itself can be configured by the client. The client does not know in advance which features and components can exist on the server. Client and Server are communicating over a network. The client should be user friendly. Technological and political constraints forbid us to use HTML/JS as a client (we use .NET).

Long story short, we want to provide a general meta-model for configuration that described configuration entities, their properties, relationships between the properties, validation rules, etc.

However we are realizing this is actually quite a complex task and I would like to hear opinions, helpfull tips and hopefully existing frameworks or models that can be used. We are currently looking at RDF as a possible language to dynamically create an ontology describing all the relationships described above, but RDF seems very complex for this.

Any ideas or suggestions?

aKzenT
  • 457

2 Answers2

1

Use a Dictionary or Key/Value list to encode sensor attributes. You can serialize it to send over the wire, and you don't need to know anything about your data model (i.e. your sensors) in advance to make it work. Include a "Type" field in your object containing the dictionary, so that you know what kind of sensor it is.

public class Sensor
{
    public SensorType SensorType { get; set; }
    public string Description { get; set; }

    // Properties common to all sensors go here
   ...

   // Properties specific to sensor type go into the dictionary.
    public Dictionary<string, string> SensorAttributes { get; set; }
}
Robert Harvey
  • 200,592
0

Why not use .NET custom configuration? It has a lot to recommend it:

  • Define configuration with any level of complexity, nesting, etc.
  • Relationships are easily defined in the config XML and easy to handle via .NET code.
  • Includes validation.
  • If defined in a separate assembly, that configuration assembly can be used across any number of projects.
  • Uses .NET convention!
  • Depending on the audience, reading XML can be very user-friendly. Grok at a glance.
  • Add a ProtectedConfigurationProvider to store configuration in alternative locations or formats. (It's not just for encryption.)
Scant Roger
  • 9,086