I have a problem about designing. I should use class or struct in this case. Example:
struct DataTicker
{
sring Symbol;
decimal Price;
decimal Volume;
}
class DataTicker
{
string Symbol;
decimal Price;
decimal Volume;
}
Assume that I have 3 projects: client, server & library. Library will define DataTicker object. Client & server will reference to this library to use this object. Client & server will send & transfer data, data can be a DataTicker object or a list of DataTicker object.
I should define DataTicker as a class or struct. And in future, If I add new fields in DataTicker and update library only at server (server will use a new DataTicker with more 3 fields), client still use old library (DataTicker with 3 fields) and can parse new DataTicker object.
Thanks.
You would definitely go with class because you have a reference type (string) as a datamember.