I created some custom types, for example:
public class Temperature
{
protected double _celcius;
public Temperature(){}
public Temperature(double celcius)
{
_celcius = celcius;
}
public double Celcius
{
}
public double Fahrenheit
{
}
}
and similar for Massetc.
I also have a custom object, for example Planet, that uses these custom types as properties.
[Serializable]
public class Planet
{
public int PositionFromSun;
public Mass Mass;
public Temperature Temperature;
}
What is the best practice for serialization Planetin this case, given that Massu Temperaturemight change a bit in the future (like adding Kelvinin Temperature)? Should I have Massand Temperatureinherit from the user interface something like IQuantity.
source
share