When writing utility classes in Java, what are some good guidelines to follow?
Should packges be \"util\" or \"utils\"? Is it ClassUtil or ClassUtils? When is a class a
I like the convention of just adding "s" to the type name when the type is an interface or a class you don't control. Examples of that in the JDK include Collections
and Executors
. It's also the convention used in Google Collections.
When you're dealing with a class you have control over, I'd say utility methods belong on the class itself generally.