I'm having something of a dilemma and would appreciate some input.
I have this class, let's call it "Car" where each instance has some individual settings (through properties), like "Color", "HasGearShift" or whatnot (I'm making this up for a simple example). These should be user customizable but there should also be default values.
So the natural solution was to take all the "settings" properties and break them into a separate "Settings" class which could be serialized/deserialized. Each Car class could also inherit the Settings class with one that sets the default values and can be serialized as the basis of user customization. Sofar so good.
The problem I feel though is that I either have to live with this kind of syntax all over the code: someCar.Settings.HasGearShift
and there's even some like this: someCar.Settings.GearBox.CurrentGear
But atleast there's no redundancy, everything is nicely encapsulated in the Settings class.
The other option is to keep the properties on the Car class and simply copy over them from the Settings class into the class. Then I can simply write someCar.HasGearShift
again. Makes referencing properties a whole lot more terse but means I have to change settings in two classes if I add/remove something.
Which one would you choose, or is there a third better way that I am missing? I'm leaning towards the second option, otherwise there'll simply be too many "trainwrecks" in the code :)