Hello all

Reminder: the issue is about renaming "range" as "interval" in the "org.apache.sis.measure" package [1] for avoiding name clash with the ISO 19123 (Schema for coverage geometry and functions [2]) concept of range.

I have trouble finding proper class names. We currently have:

 * Range - a range of any kind of Comparables (not necessarily numeric).
 * NumberRange - a range where Comparables are restricted to Numbers
 * MeasurementRange - a NumberRange with a unit of measurement.


The word "Interval" seems a perfect match for the current "NumberRange". The Wikipedia definition for "interval" [3] describes exactly the "NumberRange" behaviour: including/excluding endpoints, infinite endpoints, formatting... Even the discussion about whether infinite endpoints are inclusive or exclusive matches the NumberRange implementation choice :-). Problem is: "Interval" seems to be used exclusively for interval of numbers. For example I could easily find "character range" and "ordinal range" on Google, but have been unable to find "character interval" (or the definitions that I found were something completely different). While I found someone using the words "Numeric Interval" [4], this usage seems to be rare and do not answer the question "do non-numeric intervals exist?".

Second problem: I couldn't find how to rename "MeasurementRange". Apparently, almost everyone on the web use the term "measurement interval" for another purpose (namely: the time elapsed between two measurements in a time series). Furthermore many web sites use "measurement range" for exactly what the "MeasurementRange" class is. Consequently renaming "MeasurementRange" as "MeasurementInterval" would probably cause a more severe confusion than the one we are trying to solve.

In summary:

 * Renaming "MeasurementRange" to "MeasurementInterval" seems out of
   the question.
 * Renaming "NumberRange" to "NumericInterval" would be okay.
 * Renaming "Range" to "Interval" would be so-so, because "interval"
   seems to imply "numeric interval" in the majority of cases.

So I'm tempted to either keep the class names as they stand today (with "Range" name everywhere) and explain in the javadoc the relationship with the ISO 19123 concept of "ranges", or either rename only "NumericRange" as "Interval" and leave all other names unchanged:

 * pro:
     o Class names "Range", "Interval" and "MeasurementRange" are the
       most accurate names I can see for what those classes are.
     o On those 3 above classes, "NumberRange" was by far the most
       frequently used one, and renaming that class as "Interval" give
       him a lovely name which is both short and mathematically accurate.
     o In particular, the class used in context of ISO 19123
       implementation will be mostly NumberRange, so renaming only that
       class as "Interval" may be sufficient for avoiding a name clash
       with the ISO 19123 concept of range.
 * cons:
     o The hierarchy would be "MeasurementRange extends Interval
       extends Range". The "Interval" class name would look like a
       foreigner in the middle of all those classes using the "Range" word.


Any opinions?

    Martin


[1] https://builds.apache.org/job/sis-jdk7/site/apidocs/org/apache/sis/measure/package-summary.html
[2] http://www.opengeospatial.org/standards/as (topic 6)
[3] http://en.wikipedia.org/wiki/Interval_%28mathematics%29
[4] http://www.gabormelli.com/RKB/Numeric_Interval

Reply via email to