commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "matthew.hawthorne" <ma...@apache.org>
Subject Re: [lang] mutables
Date Sun, 13 Jun 2004 05:19:33 GMT
Henri Yandell wrote:
> First thought when looking at the code is that we could simplify things
> with a protected Number in MutableNumber, and move the intValue etc
> methods up into MutableNumber.
> 
> The getValue/ setValue(Object) can go up too, and all that would be left
> in the mutable subclass is the primitive override and the constructor.
> 
> Pro: Less code in the subclasses.
> Con: A protected rather than private variable. More memory is taken up
>      with the mutable part being an Object and not a primitive.
> 
> Just a thought.


I think the pro of simpler code may be bigger than the con of memory loss.
Those involved in hardcore performance tweaking may disagree.  For me,
the mutable classes were more about the added functionality than the savings
in memory, so I'm in agreement with you here.

---------------------------------------------------------------------
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