我有这两个类代表一些股票数据。他们没有任何行为。这些类具有一些常见的数据,如ExchangeSymbol,MySymbol和Time。你认为将这些抽象为基础类是一个好主意吗?请分享你的想法。OO设计继承
class SymbolData
{
public string ExchangeSymbol { get; set; }
public string MySymbol { get; set; }
public double Price { get; set; }
public int Volume { get; set; }
public string Time { get; set; }
}
class EquityQuoteData
{
public string ExchangeSymbol { get; set; }
public string MySymbol { get; set; }
public double AskPrice { get; set; }
public double BidPrice { get; set; }
public int AskVolumne { get; set; }
public int BidVolumne { get; set; }
public string Time { get; set; }
}