commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Gary Gregory" <>
Subject [lang] RE: Why is org.apache.commons.lang.math.IntRange final?
Date Tue, 02 Aug 2005 17:24:02 GMT
Personally, I do not see why these classes should be non-subclassable,
if that's a word. In the Range class I see: 

"Specific subclasses hold the range values as different types. Each
 * subclass should be immutable and {@link
 * if possible."

I do not know why a range should be immutable, maybe Stephen can

Seems like Range should really be an interface and not a class, then we
could have a MutableRange subinterface (subclass?) Should we have an
ImmutableRange interface with a MutableRange sub so that we can keep
Range as a class for b/w compat?

But I'm not sure that makes any sense.


> -----Original Message-----
> From: Amit Kulkarni []
> Sent: Tuesday, August 02, 2005 9:08 AM
> To:
> Subject: Why is org.apache.commons.lang.math.IntRange final?
> I am trying to extend the functionality of IntRange based on Martin
> Fowler's Analysis Pattern of "Range" to model a street Address Range.
> So for example, a street "Joe Blow St" will have an associated
> AddressRange of 2000-2999 etc...
> I wanted to extend IntRange and add the functions mentioned in the
> "Range" pattern and add some more: for e.g. to check if its valid
> (ideally in a constructor or a isValid() method). Right now I am
> into cut pasting IntRange in my AddressRange class which extends
> org.apache.commons.lang.math.Range. I would ideally like to just
> IntRange. Why are these classes finalized? Is it just because of
> security as David Wheeler says in #8
> Btw, Commons is cool! I am also using MultiKey and MultiKeyMap to
> figure out errors in street attributes.
> Thanks in advance!
> ____________________________________________________
> Start your day with Yahoo! - make it your home page
> ---------------------------------------------------------------------
> To unsubscribe, e-mail:
> For additional commands, e-mail:

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message