Say I have a class that has three properties, as shown below.
public class Travel
{
public int MinAirportArrival { get; set; }
public int MinFlightTime { get; set; }
public int TotalTravelTime { get; set; }
}
TotalTravelTime should be at least the sum of MinAirportArrival and MinFlightTime, but could also be greater if there is a stop or something like that.
It is clear to me that I can put the logic in setter for TotalTravelTime.
My question is about changing MinFlightTime and MinAirportArrival. Is it right to expect that TotalTravelTime will be increased first, and if there were no exception, if one of the others makes an amount larger than TotalTravelTime?
What are my other options for managing this in a smart way?
, , ? , .
, , . , , , , , .