commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
Subject RE: Commons Util 1.0 release candidate 1
Date Wed, 20 Feb 2002 21:34:34 GMT
I'm not a committer and in fact I've never used the commons util stuff yet
-- but I was looking at it recently and the only complaint I had was the
naming scheme.  This was probably discussed to death before I joined the
list, but here are my two thoughts -- first, it seems as if having a package
named "util" with classes under it that have "util" in the name (i.e.
util.StreamUtils) is redundant... and second, there is already a precendent
for a naming convention for these type of classes (util classes which hold
several static methods that all have to do with a particular type of data or
type) -- specifically that is the convention used by classes like
java.util.Arrays, which is to name the class after the type that it deals
with but make it plural.  In the case of the commons util package, this
would lead to changes like so:

	org.apache.commons.util.ClassUtils ->
	org.apache.commons.util.CollectionsUtils ->
	org.apache.commons.util.FileUtils -> org.apache.commons.util.Files
	org.apache.commons.util.MapUtils -> org.apache.commons.util.Maps
	org.apache.commons.util.NumberUtils ->
	org.apache.commons.util.ObjectUtils ->
	org.apache.commons.util.StreamUtils ->
	org.apache.commons.util.StringUtils ->

The only one I'm not sure how to deal with is "XmlUtils", which maybe just
becomes "Xml".

We have several packages like this here at work and it's lead to much better
naming conventions for our methods, for example we have a class and a class (we
went one step further and put the utility classes directly into the
appropriate subpackages the way the JDK does, but that clearly wouldn't work
for a commons-util scenario), which used to have methods like
copyStreamToStream() and copyFile() which, after we started using this
naming convention, became "Streams.copy()" and "Files.copy()" both of which
perform intuitively obvious tasks without having to have such verbose method
names as well as just feeling more "natural" since they conform to the
"Arrays.sort()" type of paradigm.

Anyway, like I said, I'm not a committer or anything but it seems to me that
this would be the way to go with the naming convention, and since I saw the
message about a pending release I figured now was the time to speak up
before more and more code gets written using the current naming convention.
I know that changing around all of the class names is going to be a big
pain, but it'll be easier now than later if anyone feels like it's worth
doing.  Oh well, there's my 2 cents.


-----Original Message-----
From: Daniel Rall []
Sent: Wednesday, February 20, 2002 4:07 PM
Cc: Velocity Developers List
Subject: Commons Util 1.0 release candidate 1

Prompted by Velocity's need (1.3 will use Commons Util), I've tagged
RC1, which is available here:

Note that Commons Util is still in the sandbox (rather than in the
commons module itself).


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

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

View raw message