I have a number of different objects with a varying number of attributes. Until now I have saved the data in XML files which easily allow for an ever changing number of attr
Let me give some concreteness to what DVK was saying.
Assuming values are of same type the table would look like (good luck, I feel you're going to need it):
dynamic_attribute_table ------------------------ id NUMBER key VARCHAR value SOMETYPE?
example (cars):
|id| key | value | --------------------------- | 1|'Make' |'Ford' | | 1|'Model' |'Edge' | | 1|'Color' |'Blue' | | 2|'Make' |'Chevrolet'| | 2|'Model' |'Malibu' | | 2|'MaxSpeed'|'110mph' |
Thus,
entity 1 = { ('Make', 'Ford'), ('Model', 'Edge'), ('Color', 'Blue') }
and,
entity 2 = { ('Make', 'Chevrolet'), ('Model', 'Malibu'), ('MaxSpeed', '110mph') }.