For example, say we have a ticketing system that can be configured to offer tickets at normal price, but once you're within X
hours of the event, you offer them at a different price (it may be discounted or increased). We'll call this the 'rush price'. Moreover, once you're within Y
hours of the event, you offer them at yet another price. We'll call this the 'emergency price'.
The class that represents this configuration information might look like this:
public class RushTicketPolicy {
private int rushHours;
private int emergencyHours;
public RushTicketPolicy(int rushHours, int emergencyHours) {
this.rushHours = rushHours;
this.emergencyHours = emergencyHours;
}
public int RushHours { get { return this.rushHours; } }
public int EmergencyHours { get { return this.emergencyHours; } }
}
I'm finding it extremely difficult to come up with names for these variables (and properties) that are sufficiently expressive and complete, without reference to the code that uses them and without additional inference.
That is, someone that hasn't seen the rest of the code or know anything about its business requirements should be able to look at the variable names and understand that:
- Rush sales start
X
hours before the event, inclusive. - Emergency sales start
Y
hours before the event, inclusive.
What are some names that would accomplish that?