For discussion, I have this class with properties
public class Intresting { decimal _mQty, _mSpareQty; public Qty { get { return _mQty; } set { _mQty = value; } } public SpareQty { get { return _mSpareQty; } set { _mSpareQty= value; } } public SparePercentage { get { return _mQty == 0 ? 0 : _mSpareQty / _mQty; } set { _SpareQty = Qty * value; } } }
I'm concerned If I have 1,000,000 interesting objects displayed in a custom read-only GridView that shows SparePercentage through a property, SparePercentage will be calculated over and over again or will be optimized, for example using the third _mSpareQtyPercentage, which is recounted when Qty and SpareQty installed?
source share