I have to create an application to manage custom objects with the following characteristics:
1) From a form the user can create basic custom objects which will represent parts/components. For example create a "temperature sensor" object type. This object will have custom properties such as "temperature tag (string)", "Minimum temperature (float)" and "Max temperature (float)". Another object type could be Motor with properties such as speed, power, etc.
Note: The object types would be created using a form with the possibility of editing them later by adding or removing properties.
2) On another form the user would be able to create object instances (sensor1, sensor2, motor1, etc) and see and enter the property values in a table format (we will have hundreds of instances).
3) From another form the user would be able to create higher level objects which would contain basic properties (strings, floats, etc) but also basic objects such as "temperature sensor" or "Motor".
For example an object type called "Air Con" which would have 1 basic property called "setpoint degC" (string), a measuredtemperature object (type temperature_sensor) and a fan object (type Motor).
4) After defining the basic types (sensor and Motor) and the high level object types (Air Con) we could then create multiple instances of this high level object, eg AirCon1, AirCon2, etc.
If we then modify the object type at any level, the changes should cascade across all instances.
The object types and its properties should be stored on a database such as SQL Server.
I'm not looking for code to solve this but more of guidance on the best approach. There are probably libraries or technologies out there that can do this quite easily...
What I have tried:
Options as I see it:
1 - write code that builds the database tables dynamically in runtime as we define the object types, ie add a column for each property and delete/rename as the objects are edited. Probably hard to modify the table definitions once there is already data in them. Seems messy.
2 - Create static tables with lots of spare columns which will get allocated to object properties. Messy, not sure how to create object types that contain more object types inside.
3 - Create a static table with a column of the xml type and try to put all the properties in xml format. probably complicated to map xml from a column to multiple datagrid columns?