I've been working with some serializable classes recently and they typically look something like this:
[DataContract]
public class Foo
{
[DataMember(Order = 0)]
public string Bar1
{
get;
set;
}
[DataMember(Order = 1)]
public string Bar2
{
get;
set;
}
}
I was wondering, what possible application could one have for specifying an order for the data members? The guidelines here specify that it may "Sometimes it may be necessary to change this order." but don't give any examples of when or why. Do you have any examples of when or why this may be necessary?
In my application I am simply serializing these objects of these types and saving them down to a file. Does specifying an "Order" here have any value or does it simply add something else to maintain? Would I face any problems if I simply removed "Order" from each data member?