Manuel Jordan
Manuel Jordan

Reputation: 16299

Java Naming Classes: when use Support? But taking in consideration the Helper and Utils too

About how to name a class how Helper or Utils it is clearly explained in:

It such as: XHelper or XUtils. I did do a research and I got the following results:

About Utils we can see for example in Spring Framework through:

And in Java too:

Same about Helper we can see for example in Spring Framework through:

In Java is confuse in someway because the are many Helper classes where the methods are declared how static. Something I had observed is that practically all of them are within the org.omg package and not something like java.xxx or javax.yyy

Returning to the point

But what about Support? Such as XSupport. It seems to be very similar to either Helper or Utils

There are many classes with this pattern through Java such as:

and Spring Framework

So what is the rule(s) to apply definitely the Support term for a class name? (but of course, taking in consideration the two other terms)

Upvotes: 2

Views: 1643

Answers (2)

user4413257
user4413257

Reputation:

Utils

Set of static utility methods (stateless) of some type e.g. StringUtils (Apache Commons Lang).

Note there is a more neat convention for such a class: Strings, Iterables, Lists (Guava), which is also used in Java (Arrays, Collections).

Helper

Instantiable (stateful) class which helps to build functionality of particular type i.e. simplifies work with given type.

Support

Sounds very similar to Helper, but if you consider ConfigurationSupport it feels like more than just helper, which makes things easier i.e. contains something that is required/needed to get things work.

Upvotes: 2

Yugansh
Yugansh

Reputation: 395

From the accepted answer :

A Utility class can be understood to only have static methods and be stateless. You would not create an instance of such a class.

A Helper can be a utility class or it can be stateful or require an instance be created. I would avoid this if possible.

Added how I understood about the support classes:

A Support class could be understood as the core components required to support a feature/functionality (like java.lang primitive classes and object classes) which provide the base framework can be categorized as support classes

Upvotes: 1

Related Questions