commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Gary Gregory" <ggreg...@seagullsoftware.com>
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 java.io.Serializable
Serializable}
 * if possible."

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

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.

Gary

> -----Original Message-----
> From: Amit Kulkarni [mailto:amitkulz@yahoo.com]
> Sent: Tuesday, August 02, 2005 9:08 AM
> To: commons-dev@jakarta.apache.org
> 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.
> 
> http://www.martinfowler.com/ap2/range.html
> 
> 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
range
> (ideally in a constructor or a isValid() method). Right now I am
forced
> into cut pasting IntRange in my AddressRange class which extends
> org.apache.commons.lang.math.Range. I would ideally like to just
extend
> IntRange. Why are these classes finalized? Is it just because of
> security as David Wheeler says in #8
>
http://www.dwheeler.com/secure-programs/Secure-Programs-HOWTO/java.html
> 
> 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
> http://www.yahoo.com/r/hs
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: commons-dev-help@jakarta.apache.org
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


Mime
View raw message