Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Difference between Utility and Helper classes

Tags:

Aren't utility classes really the same concept as helpers? I mean utility methods don't extend an existing class such as helpers but the two types of methods really could be referred to as "Helpers" in either case.

like image 375
PositiveGuy Avatar asked Aug 03 '09 18:08

PositiveGuy


People also ask

What is a utility class?

A utility class is a class that is just a namespace for functions. No instances of it can exist, and all its members are static. For example, java. lang. Math and java.

What is the difference between helper and service?

Service able to serve some clients, and often this is a SOA specific entity. Helper provides a set of methods which commonly are pure functions.

Is a helper class a code smell?

A Helper class is a lesser known code smell where a coder has identified some miscellaneous, commonly used operations and attempted to make them reusable by lumping them together in an unnatural grouping.

What are helper classes in java?

Helper Class is a Java class which includes basic error handling, some helper functions etc. Helper class contains functions that help in assisting the program. This Class intends to give quick implementation of basic functions such that programmers do not have to implement again and again.


1 Answers

Utility classes are useful by itself; whereas helper classes are classes with extension methods which will help extend the types.

like image 109
metsathya Avatar answered Nov 10 '22 13:11

metsathya